-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src: parse dotenv with the rest of the options
- Loading branch information
1 parent
c6269cb
commit c60746c
Showing
7 changed files
with
125 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const assert = require('node:assert'); | ||
const { test } = require('node:test'); | ||
|
||
if (!process.config.variables.node_without_node_options) { | ||
common.skip('Requires the lack NODE_OPTIONS support'); | ||
} | ||
|
||
const relativePath = '../fixtures/dotenv/node-options.env'; | ||
|
||
test('.env does not support NODE_OPTIONS', async() => { | ||
const code = `assert.strictEqual(process.permission, undefined)`; | ||
const child = await common.spawnPromisified( | ||
process.execPath, | ||
[ `--env-file=${relativePath}`, '--eval', code ], | ||
{ cwd: __dirname }, | ||
); | ||
// NODE_NO_WARNINGS is set, so `stderr` should not contain | ||
// "ExperimentalWarning: Permission is an experimental feature" message | ||
// and thus be empty | ||
assert.strictEqual(child.stdout, ''); | ||
assert.strictEqual(child.stderr, ''); | ||
assert.strictEqual(child.code, 0); | ||
}); |