aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGravatar Dylan Conway <35280289+dylan-conway@users.noreply.github.com> 2023-07-21 20:33:15 -0700
committerGravatar GitHub <noreply@github.com> 2023-07-21 20:33:15 -0700
commit2323f5d08d4c1d85d65ac89460dac592a7514fbd (patch)
tree4f9a18db311ae5a672f63ca00b2dd5a8cf3f88a2 /test
parent311dffc690f346cc81dd82fb338faaf858cf9318 (diff)
downloadbun-2323f5d08d4c1d85d65ac89460dac592a7514fbd.tar.gz
bun-2323f5d08d4c1d85d65ac89460dac592a7514fbd.tar.zst
bun-2323f5d08d4c1d85d65ac89460dac592a7514fbd.zip
fix #3716 (#3733)
* don't break on comments for process env variables * break for `\r` and `\n` * don't parse process env vars
Diffstat (limited to 'test')
-rw-r--r--test/cli/run/env.test.ts8
1 files changed, 8 insertions, 0 deletions
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",