A better assert message for node

npm install assertmessage
8 downloads in the last week
25 downloads in the last month


Improves the output for assert failure messages. The normal assert message includes either the message, or the actual/expected comparison. This package will output both to give test runners more context for test failures.

Require this library as you would normally require assert and carry on.

var assert = require('assertmessage');

describe('any test you want', function () {
    it('outputs a better message on failure', function () {
        assert.equal(false, true, 'Your informative message,
        ie why is false true?');
// Should result in both the message, and the actual and expected
// values getting output
npm loves you