summaryrefslogtreecommitdiff
path: root/test/parallel/test-worker-syntax-error.js
blob: 99ebf26a9fa714cb523c0f8eee0b1a7369f743e7 (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.strictEqual(err.name, 'SyntaxError');
}));