Skip to content

Commit

Permalink
disable assertion output for t.throws
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadim Demedes committed Jan 31, 2017
1 parent b139bc6 commit 9ea5af4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function create(val, expected, operator, msg, fn) {
function test(ok, opts) {
if (!ok) {
const err = new assert.AssertionError(opts);
err.showOutput = ['fail'].indexOf(err.operator) === -1;
err.showOutput = ['fail', 'throws', 'notThrows'].indexOf(err.operator) === -1;
throw err;
}
}
Expand Down Expand Up @@ -111,7 +111,7 @@ x.throws = (fn, err, msg) => {

return result;
} catch (err) {
test(false, create(err.actual, err.expected, err.operator, err.message, x.throws));
test(false, create(err.actual, err.expected, 'throws', err.message, x.throws));
}
};

Expand All @@ -136,7 +136,7 @@ x.notThrows = (fn, msg) => {
try {
assert.doesNotThrow(fn, msg);
} catch (err) {
test(false, create(err.actual, err.expected, err.operator, err.message, x.notThrows));
test(false, create(err.actual, err.expected, 'notThrows', err.message, x.notThrows));
}
};

Expand Down

0 comments on commit 9ea5af4

Please sign in to comment.