Skip to content

Commit

Permalink
assert: fix misformatted error message
Browse files Browse the repository at this point in the history
Before: `Missing expected exception..`

Afer: `Missing expected exception.`
  • Loading branch information
Trott committed Feb 10, 2017
1 parent b471392 commit 9df45db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ function _throws(shouldThrow, block, expected, message) {
actual = _tryBlock(block);

message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
(message ? ' ' + message : '.');
(message ? ' ' + message : '');

if (shouldThrow && !actual) {
fail(actual, expected, 'Missing expected exception' + message);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ testAssertionMessage({a: NaN, b: Infinity, c: -Infinity},
});
} catch (e) {
threw = true;
assert.strictEqual(e.message, 'Missing expected exception..');
assert.strictEqual(e.message, 'Missing expected exception.');
}
assert.ok(threw);
}
Expand Down

0 comments on commit 9df45db

Please sign in to comment.