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) • 732 B
JavaScript
var Must = require("../..")
var assert = require("./assert")
describe(".prototype.least", function() {
it("must pass if above", function() {
assert.pass(function() { Must(69).be.at.least(42) })
})
it("must pass if equal", function() {
assert.pass(function() { Must(69).be.at.least(69) })
})
it("must fail if below", function() {
assert.fail(function() { Must(69).be.at.least(1337) })
})
require("./_assertion_error_test")(function() { Must(42).be.at.least(69) }, {
actual: 42,
expected: 69,
message: "42 must be at least 69"
})
describe(".not", function() {
it("must invert the assertion", function() {
assert.fail(function() { Must(69).not.be.at.least(42) })
})
})
})