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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • 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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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.