Skip to content

Commit

Permalink
test: add missing test for env file
Browse files Browse the repository at this point in the history
PR-URL: #56642
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Jake Yuesong Li <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
JonasBa authored Jan 24, 2025
1 parent 19fabc0 commit 01a5aa2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/parallel/test-dotenv-edge-cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,16 @@ describe('.env supports edge cases', () => {
assert.strictEqual(SingleQuotesChild.stderr, '');
assert.strictEqual(SingleQuotesChild.code, 0);
});

it('should reject invalid env file flag', async () => {
const child = await common.spawnPromisified(
process.execPath,
['--env-file-ABCD', validEnvFilePath],
{ cwd: __dirname },
);

assert.strictEqual(child.stdout, '');
assert.strictEqual(child.code, 9);
assert.match(child.stderr, /bad option: --env-file-ABCD/);
});
});

0 comments on commit 01a5aa2

Please sign in to comment.