summaryrefslogtreecommitdiff
path: root/test/parallel/test-worker-esm-missing-main.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2019-04-21 22:25:37 -0700
committerRich Trott <rtrott@gmail.com>2019-04-23 22:40:46 -0700
commit9b982feedf76ac51fe4ed1aaf22026cbb0df1a5e (patch)
tree65c24ae22807c88a4f0a7057724f8955a2954985 /test/parallel/test-worker-esm-missing-main.js
parent1a54d0fa59e0e1c90db1b66907c48a286d5b26a3 (diff)
downloadandroid-node-v8-9b982feedf76ac51fe4ed1aaf22026cbb0df1a5e.tar.gz
android-node-v8-9b982feedf76ac51fe4ed1aaf22026cbb0df1a5e.tar.bz2
android-node-v8-9b982feedf76ac51fe4ed1aaf22026cbb0df1a5e.zip
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>
Diffstat (limited to 'test/parallel/test-worker-esm-missing-main.js')
-rw-r--r--test/parallel/test-worker-esm-missing-main.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/parallel/test-worker-esm-missing-main.js b/test/parallel/test-worker-esm-missing-main.js
index 8d2cf8f3f3..8f4cfb0fe7 100644
--- a/test/parallel/test-worker-esm-missing-main.js
+++ b/test/parallel/test-worker-esm-missing-main.js
@@ -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