Skip to content

Commit 4565fa2

Browse files
committed
src: fix env var TZ test
In some CI environments the TZ env var is set. Since a .env file won't override that, we need to create an env where the test can still run by deleting the TZ variable.
1 parent d91ebce commit 4565fa2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/parallel/test-dotenv-node-options.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ describe('.env supports NODE_OPTIONS', () => {
4848
const code = `
4949
require('assert')(new Date().toString().includes('Hawaii'))
5050
`.trim();
51+
const env = { ...process.env };
52+
delete env.TZ;
5153
const child = await common.spawnPromisified(
5254
process.execPath,
5355
[ `--env-file=${relativePath}`, '--eval', code ],
54-
{ cwd: __dirname },
56+
{ cwd: __dirname, env },
5557
);
5658
assert.strictEqual(child.stderr, '');
5759
assert.strictEqual(child.code, 0);

0 commit comments

Comments
 (0)