test: make test-worker-esm-missing-main more robust
test-worker-esm-missing-main failed in CI recently in a way that suggests that maybe the `does-not-exist.js` file did in fact exist. Maybe that isn't what happened at all, but let's rule it out by changing the use of `does-not-exist.js` from a file expected to be missing from the current working directory to a file in the temp directory, which the test will remove and recreate at the outset. PR-URL: https://github.com/nodejs/node/pull/27340 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
This commit is contained in:
parent
1a54d0fa59
commit
9b982feedf
@ -1,11 +1,14 @@
|
||||
'use strict';
|
||||
const common = require('../common');
|
||||
const assert = require('assert');
|
||||
const path = require('path');
|
||||
const { Worker } = require('worker_threads');
|
||||
|
||||
const worker = new Worker('./does-not-exist.js', {
|
||||
execArgv: ['--experimental-modules'],
|
||||
});
|
||||
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'] });
|
||||
|
||||
worker.on('error', common.mustCall((err) => {
|
||||
// eslint-disable-next-line node-core/no-unescaped-regexp-dot
|
||||
|
Loading…
x
Reference in New Issue
Block a user