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

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Rich Trott 2017-10-17 16:29:32 -07:00 committed by James M Snell
parent 0efb6db390
commit 9ae8416645

View File

@ -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) {