From 6d173d52ccc44adf412b1d299a11fde898c546fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Fri, 7 Jul 2023 11:42:05 +0200 Subject: [PATCH] test: adapt REPL test to V8 changes Syntax errors from `JSON.parse` contain more information and can now be printed on two lines if they are long. --- test/parallel/test-repl.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js index 74299d4b4cb..98a0bc79c64 100644 --- a/test/parallel/test-repl.js +++ b/test/parallel/test-repl.js @@ -209,7 +209,10 @@ const errorTests = [ // should throw { send: 'JSON.parse(\'{invalid: \\\'json\\\'}\');', - expect: [/^Uncaught SyntaxError: /] + expect: [ + 'Uncaught:', + /^SyntaxError: /, + ], }, // End of input to JSON.parse error is special case of syntax error, // should throw @@ -220,7 +223,10 @@ const errorTests = [ // should throw { send: 'JSON.parse(\'{\');', - expect: [/^Uncaught SyntaxError: /] + expect: [ + 'Uncaught:', + /^SyntaxError: /, + ], }, // invalid RegExps are a special case of syntax error, // should throw