Skip to content

Commit d84a6d0

Browse files
Trotttargos
authored andcommitted
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: #27340 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
1 parent ee80a21 commit d84a6d0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/parallel/test-worker-esm-missing-main.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
'use strict';
22
const common = require('../common');
33
const assert = require('assert');
4+
const path = require('path');
45
const { Worker } = require('worker_threads');
56

6-
const worker = new Worker('./does-not-exist.js', {
7-
execArgv: ['--experimental-modules'],
8-
});
7+
const tmpdir = require('../common/tmpdir');
8+
tmpdir.refresh();
9+
const missing = path.join(tmpdir.path, 'does-not-exist.js');
10+
11+
const worker = new Worker(missing, { execArgv: ['--experimental-modules'] });
912

1013
worker.on('error', common.mustCall((err) => {
1114
// eslint-disable-next-line node-core/no-unescaped-regexp-dot

0 commit comments

Comments
 (0)