Skip to content

Commit

Permalink
fixup! worker: provide process.execArgv
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax committed Mar 1, 2019
1 parent 962d013 commit 7cfad4c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/parallel/test-worker-execargv.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ const assert = require('assert');
// This test ensures that Workers have the ability to get
// their own command line flags.

const { Worker, isMainThread } = require('worker_threads');
const { Worker } = require('worker_threads');
const { StringDecoder } = require('string_decoder');
const decoder = new StringDecoder('utf8');

if (isMainThread) {
// Do not use isMainThread so that this test itself can be run inside a Worker.
if (!process.env.HAS_STARTED_WORKER) {
process.env.HAS_STARTED_WORKER = 1;
const w = new Worker(__filename, { execArgv: ['--trace-warnings'] });
w.stderr.on('data', common.mustCall((chunk) => {
const error = decoder.write(chunk);
Expand Down

0 comments on commit 7cfad4c

Please sign in to comment.