Files
bun.sh/test/cli/run/empty-file.test.ts
Julian 1b949d4f5a 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>
2023-09-18 20:14:32 -07:00

16 lines
463 B
TypeScript

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);
});