diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/cli/run/env.test.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/cli/run/env.test.ts b/test/cli/run/env.test.ts index 0cab610a5..e6ee99dd2 100644 --- a/test/cli/run/env.test.ts +++ b/test/cli/run/env.test.ts @@ -308,3 +308,13 @@ test(".env Windows-style newline (issue #3042)", () => { const { stdout } = bunRun(`${dir}/index.ts`); expect(stdout).toBe("|bar\n\nbaz|moo"); }); + +test(".env with zero length strings", () => { + const dir = tempDirWithFiles("dotenv-issue-zerolength", { + ".env": "FOO=''\n", + "index.ts": + "function i(a){return a}\nconsole.log([process.env.FOO,i(process.env).FOO,process.env.FOO.length,i(process.env).FOO.length].join('|'));", + }); + const { stdout } = bunRun(`${dir}/index.ts`); + expect(stdout).toBe("||0|0"); +}); |