Skip to content

Commit

Permalink
test: make test-repl-harmony 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 `TypeError`.

PR-URL: #16272
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
Trott authored and evanlucas committed Nov 13, 2017
1 parent 591a692 commit c81b086
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/parallel/test-repl-harmony.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ const args = ['-i'];
const child = spawn(process.execPath, args);

const input = '(function(){"use strict"; const y=1;y=2})()\n';
const expectOut = /^> TypeError: Assignment to constant variable\.\n/;
// This message will vary based on JavaScript engine, so don't check the message
// contents beyond confirming that the `Error` is a `TypeError`.
const expectOut = /^> TypeError: /;

child.stderr.setEncoding('utf8');
child.stderr.on('data', function(c) {
Expand Down

0 comments on commit c81b086

Please sign in to comment.