Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
Trott committed Apr 22, 2019
commit 001abf922081a6c19a3797bbba35486f9a88ae80
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