Improved assert
JavaScript
Pull request Compare This branch is 7 commits ahead, 2 commits behind visionmedia:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
Readme.md
asserto.js
package.json

Readme.md

Asserto

Improved assert, supporting the feature set of Expresso's assert used to easily migrate away Expresso to another testing framework. nothing special, just module.exports TJ's code from expresso as a small module

Features

  • assert.eql() alias of assert.deepEqual()
  • assert.includes()
  • assert.type()
  • assert.isNull()
  • assert.isUndefined()
  • assert.isNotNull()
  • assert.isDefined()
  • assert.match()
  • assert.length()
  • assert.response() with slightly different callback style: was function(res), now: function(err, res){}

Response

assert.response now looks like this:

assert.response({ url : '/someLocalEndpoint', method : 'POST', headers : { 'Content-Type' : 'application/json' } }, { status : 200 }, function(err, res) { assert.ok(!err); assert.equal(res.headers['content-type'], 'application/json'); });