Skip to content

Commit da3c7a8

Browse files
author
Juan Soto
committed
Add default message to x.fail(), update related test
1 parent d5b25f2 commit da3c7a8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/assert.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ x.pass = function (msg) {
3030
};
3131

3232
x.fail = function (msg) {
33+
msg = msg || 'Test failed via t.fail()';
3334
test(false, create(false, false, 'fail', msg, x.fail));
3435
};
3536

test/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ test('fail-fast mode', function (t) {
6666
t.ok(api.options.failFast);
6767
t.is(api.passCount, 1);
6868
t.is(api.failCount, 1);
69-
t.true(/false fail false/.test(api.errors[0].error.message));
69+
t.true(/Test failed via t.fail()/.test(api.errors[0].error.message));
7070
});
7171
});
7272

0 commit comments

Comments
 (0)