Skip to content

Commit

Permalink
test: fix check error name on error instance
Browse files Browse the repository at this point in the history
PR-URL: #32508
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
himself65 authored and jasnell committed Apr 7, 2020
1 parent fd2b35c commit 6ed912d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/parallel/test-worker-syntax-error-file.js
Expand Up @@ -11,7 +11,7 @@ if (!process.env.HAS_STARTED_WORKER) {
w.on('message', common.mustNotCall());
w.on('error', common.mustCall((err) => {
assert.strictEqual(err.constructor, SyntaxError);
assert(/SyntaxError/.test(err));
assert.strictEqual(err.name, 'SyntaxError');
}));
} else {
throw new Error('foo');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-worker-syntax-error.js
Expand Up @@ -7,5 +7,5 @@ const w = new Worker('abc)', { eval: true });
w.on('message', common.mustNotCall());
w.on('error', common.mustCall((err) => {
assert.strictEqual(err.constructor, SyntaxError);
assert(/SyntaxError/.test(err));
assert.strictEqual(err.name, 'SyntaxError');
}));

0 comments on commit 6ed912d

Please sign in to comment.