mirror of
https://github.com/chaijs/chai
synced 2024-11-15 00:07:11 +00:00
assert: .fail() parameter mismatch. Closes #206
This commit is contained in:
parent
1e6b30555d
commit
b01eba75c9
2 changed files with 5 additions and 6 deletions
|
@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -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 () {
|
||||
|
|
Loading…
Reference in a new issue