assert.js - A better, chaining assert syntax
assert.js provide a simple and powerful chaining based assertion syntax. In addition there is a not
modifier that may be used to invert the truth value of an assertion. The examples below give you some idea of the API:
var a = 10;var b = 1 2 3 4; ; // ok; // ok; // ok, double negation; // ok, note that we compare content! ; // ok since 10 e [0, 10]; // ok since 10 e [0, [; // ok since 10 e ], 10] ; // ok since a is not undefined ; // ok; // ok, matches number ; // ok, matches 10; // not ok, raises AssertionError
License
assert.js is available under MIT. See LICENSE for more details.