2019-01-28 16:20:40 +01:00
|
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
const assert = require('assert');
|
2019-04-21 22:25:37 -07:00
|
|
|
const path = require('path');
|
2019-01-28 16:20:40 +01:00
|
|
|
const { Worker } = require('worker_threads');
|
|
|
|
|
2019-04-21 22:25:37 -07:00
|
|
|
const tmpdir = require('../common/tmpdir');
|
|
|
|
tmpdir.refresh();
|
|
|
|
const missing = path.join(tmpdir.path, 'does-not-exist.js');
|
|
|
|
|
|
|
|
const worker = new Worker(missing, { execArgv: ['--experimental-modules'] });
|
2019-01-28 16:20:40 +01:00
|
|
|
|
|
|
|
worker.on('error', common.mustCall((err) => {
|
|
|
|
// eslint-disable-next-line node-core/no-unescaped-regexp-dot
|
|
|
|
assert(/Cannot find module .+does-not-exist.js/.test(err.message), err);
|
|
|
|
}));
|