Skip to content

Commit

Permalink
test: adapt REPL test to V8 changes
Browse files Browse the repository at this point in the history
Syntax errors from `JSON.parse` contain more information and
can now be printed on two lines if they are long.
  • Loading branch information
targos authored and nodejs-github-bot committed Sep 25, 2023
1 parent 472c2ee commit 28f7ce5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/parallel/test-repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 28f7ce5

Please sign in to comment.