Skip to content

Commit

Permalink
test: check control characters replacing
Browse files Browse the repository at this point in the history
Add test that creates an error with a control character in the message.

PR-URL: #24182
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
alegatti authored and BridgeAR committed Nov 13, 2018
1 parent 75e4f7d commit f805db3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/parallel/test-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,14 @@ common.expectsError(
});

{

assert.throws(() => {
assert.ok((() => Boolean('' === false))());
}, {
message: 'The expression evaluated to a falsy value:\n\n' +
" assert.ok((() => Boolean('\\u0001' === false))())\n"
});

const errFn = () => {
const err = new TypeError('Wrong value');
err.code = 404;
Expand Down

0 comments on commit f805db3

Please sign in to comment.