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 codebytere committed Jan 12, 2019
1 parent 07b7db2 commit 454ede2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/parallel/test-assert.js
Expand Up @@ -835,6 +835,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 454ede2

Please sign in to comment.