node/test/fixtures/test-runner/process-env.js
Ethan Arrowood ec15c3b7b1
test_runner: add env option to run function
Support an `env` option that is passed to the underlying child_process.

Fixes: https://github.com/nodejs/node/issues/60709
PR-URL: https://github.com/nodejs/node/pull/61367
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-01-29 08:18:11 +00:00

7 lines
392 B
JavaScript

const { test } = require('node:test');
test('process.env is correct', (t) => {
t.assert.strictEqual(process.env.ABC, undefined, 'main process env var should be undefined');
t.assert.strictEqual(process.env.NODE_TEST_CONTEXT, 'child-v8', 'NODE_TEST_CONTEXT should be set by run()');
t.assert.strictEqual(process.env.FOOBAR, 'FUZZBUZZ', 'specified env var should be defined');
});