node package manager
Orgs are free. Discover, share, and reuse code in your team. Create a free org ยป

asserto

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'); });