expressive-assertion
Expressive assertions for JavaScript.
Getting Started
Installation
npm install expressive-assertion --save
Integration
var assert = ;
API
assert(predicate, [...])
; // OK ; // AssertionError: assert(function () { return false; }) ; // OK ; // AssertionError: assert(function () { return false; })
assert.throws(block, [predicate], [...])
assert; // OK assert; // AssertionError: Missing expected exception. assert; // OK assert; // AssertionError: assert(function (exception) { return exception !== 'foo'; }) assert; // AssertionError: Missing expected exception. assert; // OK assert; // AssertionError: assert(function (exception) { return exception !== 'foo'; }) assert; // AssertionError: Missing expected exception.
Running Tests
To run the test suite first install the development dependencies:
npm install
then run the tests:
npm test