must
Version:
Testing and assertion library with friendly BDD syntax — awesome.must.be.true(). Many expressive matchers and is test runner and framework agnostic. Follows RFC 2119 with its use of MUST. Good and well tested stuff.
29 lines (23 loc) • 714 B
JavaScript
var Must = require("../..")
var assert = require("./assert")
describe(".prototype.above", function() {
it("must pass if above", function() {
assert.pass(function() { Must(69).be.above(42) })
})
it("must fail if equal", function() {
assert.fail(function() { Must(69).be.above(69) })
})
it("must fail if below", function() {
assert.fail(function() { Must(69).be.above(1337) })
})
require("./_assertion_error_test")(function() { Must(42).be.above(69) }, {
actual: 42,
expected: 69,
message: "42 must be above 69"
})
describe(".not", function() {
it("must invert the assertion", function() {
assert.fail(function() { Must(69).not.be.above(42) })
})
})
})