From 2323f5d08d4c1d85d65ac89460dac592a7514fbd Mon Sep 17 00:00:00 2001 From: Dylan Conway <35280289+dylan-conway@users.noreply.github.com> Date: Fri, 21 Jul 2023 20:33:15 -0700 Subject: fix #3716 (#3733) * don't break on comments for process env variables * break for `\r` and `\n` * don't parse process env vars --- test/cli/run/env.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/cli/run/env.test.ts b/test/cli/run/env.test.ts index 8ae824607..6e4d83d44 100644 --- a/test/cli/run/env.test.ts +++ b/test/cli/run/env.test.ts @@ -230,6 +230,14 @@ test(".env comments", () => { expect(stdout).toBe("foo bar"); }); +test(".env process variables no comments", () => { + const dir = tempDirWithFiles("env-no-comments", { + "index.ts": "console.log(process.env.TEST1, process.env.TEST2);", + }); + const { stdout } = bunRun(`${dir}/index.ts`, { TEST1: "test#1", TEST2: '"test#2"' }); + expect(stdout).toBe('test#1 "test#2"'); +}); + test(".env escaped dollar sign", () => { const dir = tempDirWithFiles("dotenv-dollar", { ".env": "FOO=foo\nBAR=\\$FOO", -- cgit v1.2.3