app/lib/assertions/functionCallbacksError.js

  1. /**
  2. * Asserts error for function callback
  3. * @module
  4. */
  5. var assert = require('assert');
  6. var it = require('./it');
  7. module.exports = it('callbacks error', function(test, done) {
  8. test.params.push(function(error) {
  9. try {
  10. assert.equal(error.message, test.error);
  11. done();
  12. } catch (error) {
  13. done(error);
  14. }
  15. });
  16. test.subject.apply(test.context, test.params);
  17. });