From 0da30f9686ced3faa4c0da6979c8389e89042140 Mon Sep 17 00:00:00 2001 From: Alessandro Gatti Date: Tue, 6 Nov 2018 17:16:52 +0100 Subject: [PATCH] test: check control characters replacing Add test that creates an error with a control character in the message. PR-URL: https://github.com/nodejs/node/pull/24182 Reviewed-By: Ruben Bridgewater Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- test/parallel/test-assert.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index e5a7d1aaaa90d8..695d890f4c5f6f 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -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;