Skip to content

Commit

Permalink
worker: add test for env option when using process-only cli flag
Browse files Browse the repository at this point in the history
It should be possible to pass the `env` option to a worker
even when the parent process is using a process-level flag, such
as `--title` or a V8-specific flag.

This test is currently failing in Node.js 22.2.0
  • Loading branch information
nicolo-ribaudo committed May 16, 2024
1 parent 6a2d6df commit cc4e8f2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/parallel/test-worker-env-option-with-v8-cli-flags.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Flags: --expose_gc
'use strict';
require('../common');
const { Worker } = require('worker_threads');

// Test that it does not crash
new Worker('', { eval: true, env: {} });
new Worker('', { eval: true, env: process.env });
new Worker('', { eval: true, env: { HELLO: 'hi!' } });

0 comments on commit cc4e8f2

Please sign in to comment.