diff options
author | 2023-09-18 20:14:32 -0700 | |
---|---|---|
committer | 2023-09-18 20:14:32 -0700 | |
commit | 1b949d4f5a855838c7169a4a6033fee6638c87f8 (patch) | |
tree | b8cca531ab95a4a0e613bbcee877d6bb0d4d3951 /test | |
parent | 064721668740397763a2ab6b6293d5d34a7b14a8 (diff) | |
download | bun-1b949d4f5a855838c7169a4a6033fee6638c87f8.tar.gz bun-1b949d4f5a855838c7169a4a6033fee6638c87f8.tar.zst bun-1b949d4f5a855838c7169a4a6033fee6638c87f8.zip |
`bun run` fix missing script error on empty file (#5025)
* Fix empty file not found bug
* Add tests
* fix test
---------
Co-authored-by: Jeremy Funk <jeremy@kombo.dev>
Co-authored-by: dave caruso <me@paperdave.net>
Diffstat (limited to 'test')
-rw-r--r-- | test/cli/run/empty-file.js | 0 | ||||
-rw-r--r-- | test/cli/run/empty-file.test.ts | 15 |
2 files changed, 15 insertions, 0 deletions
diff --git a/test/cli/run/empty-file.js b/test/cli/run/empty-file.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/test/cli/run/empty-file.js diff --git a/test/cli/run/empty-file.test.ts b/test/cli/run/empty-file.test.ts new file mode 100644 index 000000000..f29162bf7 --- /dev/null +++ b/test/cli/run/empty-file.test.ts @@ -0,0 +1,15 @@ +import { it, expect } from "bun:test"; +import { bunEnv, bunExe } from "harness"; +import { join } from "path"; + +it("should execute empty scripts", () => { + const { stdout, stderr, exitCode } = Bun.spawnSync({ + cmd: [bunExe(), "run", "--bun", join(import.meta.dir, "empty-file.js")], + env: bunEnv, + stdout: "pipe", + stderr: "pipe", + }); + expect(stdout.toString()).toBeEmpty(); + expect(stderr.toString()).toBeEmpty(); + expect(exitCode).toBe(0); +}); |