summaryrefslogtreecommitdiff
path: root/test/parallel/test-worker-syntax-error.js
blob: 1c1fbf1c1ab3a0af1c234f25e4c374ed19138700 (plain)
1
2
3
4
5
6
7
8
9
10
11
'use strict';
const common = require('../common');
const assert = require('assert');
const { Worker } = require('worker_threads');

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));
}));