Fluent assertions
Fluent assertions library extracted from pavlov.
$ npm install --save-dev pavlov-assert
If you are using typescript, type definitions will be automatically provided.
Here's a basic example using mocha
's BDD interface:
var assert = require('pavlov-assert');
describe('My test suite', function() {
it('passes if value is false', function() {
var value = !true;
assert(value, 'value').isFalse('should be false');
});
});
Assuming:
var assert = require('pavlov-assert');
Creates an assertion handler for the given value.
Type: any
Value to assert against.
Returns: an object that can perform assertions on the supplied value.
Passes with the given message.
Fails with the given message.
Tests strict equality.
Tests non-strict equality.
Tests the type string for the given value.
Tests strict equality to true
.
Tests strict equality to false
.
Compares against null
and undefined
.
Tests deep equality.
Tests that the supplied function throws an Error
.
Tests that the supplied function throws an Error
with a matching message.
Convenience functions for testing strict type equality.
-
Clone git repository
-
npm install
(will install dev dependencies needed by the next step) -
npm start
(will start a file system watcher that will re-lint JavaScript and JSON files + re-run all tests when change is detected) -
Make changes, don't forget to add tests, submit a pull request.
MIT © Pandell Technology
Based on Pavlov, Copyright (c) 2009-2011 Michael Monteleone, http://michaelmonteleone.net, used under the terms of the MIT license.