Skip to content

Commit

Permalink
test: make test-worker-esm-missing-main more robust
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trott authored and targos committed Apr 27, 2019
1 parent ee80a21 commit d84a6d0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/parallel/test-worker-esm-missing-main.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit d84a6d0

Please sign in to comment.