Skip to content

Commit 738aa30

Browse files
committed
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. PR-URL: #49639 Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent de5c009 commit 738aa30

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/parallel/test-repl.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,10 @@ const errorTests = [
209209
// should throw
210210
{
211211
send: 'JSON.parse(\'{invalid: \\\'json\\\'}\');',
212-
expect: [/^Uncaught SyntaxError: /]
212+
expect: [
213+
'Uncaught:',
214+
/^SyntaxError: /,
215+
],
213216
},
214217
// End of input to JSON.parse error is special case of syntax error,
215218
// should throw
@@ -220,7 +223,10 @@ const errorTests = [
220223
// should throw
221224
{
222225
send: 'JSON.parse(\'{\');',
223-
expect: [/^Uncaught SyntaxError: /]
226+
expect: [
227+
'Uncaught:',
228+
/^SyntaxError: /,
229+
],
224230
},
225231
// invalid RegExps are a special case of syntax error,
226232
// should throw

0 commit comments

Comments
 (0)