Skip to content

Commit

Permalink
test: make test-cli-syntax engine agnostic
Browse files Browse the repository at this point in the history
Do not check the error message if it is generated by the JavaScript
engine (V8, ChakraCore, etc.). Do confirm that it is a `SyntaxError`.

PR-URL: #16272
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
  • Loading branch information
Trott authored and MylesBorins committed Feb 13, 2018
1 parent a4e2ced commit f82065f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/parallel/test-cli-syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ const syntaxArgs = [
['--check']
];

const syntaxErrorRE = /^SyntaxError: Unexpected identifier$/m;
// Match on the name of the `Error` but not the message as it is different
// depending on the JavaScript engine.
const syntaxErrorRE = /^SyntaxError: \b/m;
const notFoundRE = /^Error: Cannot find module/m;

// test good syntax with and without shebang
Expand Down

0 comments on commit f82065f

Please sign in to comment.