test: make test-error-reporting engine agnostic

Remove or modify checks in test-error-reporting that only apply to V8
and not to ChakraCore.

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 15:52:40 -07:00 committed by James M Snell
parent c38c31812e
commit f16507bd22

View File

@ -32,17 +32,14 @@ function errExec(script, callback) {
assert.ok(err);
// More than one line of error output.
assert.ok(stderr.split('\n').length > 2);
// Assert the script is mentioned in error output.
assert.ok(stderr.includes(script));
assert.ok(stderr.split('\n').length);
// Proxy the args for more tests.
callback(err, stdout, stderr);
});
}
const syntaxErrorMessage = /SyntaxError/;
const syntaxErrorMessage = /\bSyntaxError\b/;
// Simple throw error
@ -65,7 +62,6 @@ errExec('throws_error3.js', common.mustCall(function(err, stdout, stderr) {
// throw ILLEGAL error
errExec('throws_error4.js', common.mustCall(function(err, stdout, stderr) {
assert.ok(/\/\*\*/.test(stderr));
assert.ok(syntaxErrorMessage.test(stderr));
}));