Must

must

Testing and assertion library with friendly BDD syntax!

must provides a BDD syntax for all your assertions and it follows RFC 2119 with its use of MUST. Good and well testsed stuff.

Get it: npm install --save must

Sample usage:

1
2
3
4
5
6
7
8
9
10
11
12
13
require("must/register");

[].must.be.empty();

obj.must.have.nonenumerable("foo");

(42).must.be.above(13);

Promise.resolve(42).must.then.equal(42);

Promise.resolve([1, 2, 3]).must.eventually.not.include(42);

Promise.reject(new Error("Problemo")).must.reject.with.error(/problem/i);

GIF FTW!

must.gif

We must thank Andri Möll for must

Suggest a module

Comments