UNPKG

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.

23 lines (19 loc) 556 B
var Must = require("../..") var assert = require("./assert") describe("Must.prototype.ownKeys", function() { require("./_keys_test")("ownKeys", false) require("./_assertion_error_test")(function() { Must({a: 1}).have.ownKeys(["a", "b"]) }, { actual: {a: 1}, expected: ["a", "b"], message: "{\"a\":1} must have own keys [\"a\",\"b\"]" }) describe(".not", function() { it("must invert the assertion", function() { assert.fail(function() { Must({a: 1, b: 2}).not.have.ownKeys(["a", "b"]) }) }) }) })