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 <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
alegatti authored and Trott committed Nov 12, 2018
1 parent 8efad19 commit 9604856
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/parallel/test-assert.js
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 9604856

Please sign in to comment.