mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
test: fix check error name on error instance
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
9039c03967
commit
2cf7381a87
2 files changed
+2
-2
No files matched your search
@@ -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');
|
||||
|
||||
@@ -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');
|
||||
}));
|
||||
Reference in new issue
Block a user