Skip to content

Commit f82065f

Browse files
TrottMylesBorins
authored andcommittedFeb 13, 2018
test: make test-cli-syntax engine agnostic
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]>
1 parent a4e2ced commit f82065f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎test/parallel/test-cli-syntax.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ const syntaxArgs = [
1313
['--check']
1414
];
1515

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

1921
// test good syntax with and without shebang

0 commit comments

Comments
 (0)