assert: .fail() parameter mismatch. Closes #206

This commit is contained in:
Jake Luer 2014-01-29 16:23:04 -05:00
parent 1e6b30555d
commit b01eba75c9
2 changed files with 5 additions and 6 deletions

View file

@ -55,13 +55,12 @@ module.exports = function (chai, util) {
*/
assert.fail = function (actual, expected, message, operator) {
throw new chai.AssertionError({
message = message || 'assert.fail()';
throw new chai.AssertionError(message, {
actual: actual
, expected: expected
, message: message
, operator: operator
, stackStartFunction: assert.fail
});
}, assert.fail);
};
/**

View file

@ -12,8 +12,8 @@ describe('assert', function () {
it('fail', function () {
chai.expect(function () {
assert.fail();
}).to.throw(chai.AssertionError);
assert.fail(0, 1, 'this has failed');
}).to.throw(chai.AssertionError, /this has failed/);
});
it('isTrue', function () {