aboutsummaryrefslogtreecommitdiff
path: root/test/cli/install/bun-run.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/cli/install/bun-run.test.ts')
-rw-r--r--test/cli/install/bun-run.test.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/cli/install/bun-run.test.ts b/test/cli/install/bun-run.test.ts
index 4180c9716..781e11c43 100644
--- a/test/cli/install/bun-run.test.ts
+++ b/test/cli/install/bun-run.test.ts
@@ -234,3 +234,25 @@ for (const entry of await decompress(Buffer.from(buffer))) {
]);
expect(await exited2).toBe(0);
});
+
+it("should not crash when downloading a non-existent module, issue#4240", async () => {
+ await writeFile(
+ join(run_dir, "test.js"),
+ `
+import { prueba } from "pruebadfasdfasdkafasdyuif.js";
+ `,
+ );
+ const { exited: exited } = spawn({
+ cmd: [bunExe(), "test.js"],
+ cwd: run_dir,
+ stdin: null,
+ stdout: "pipe",
+ stderr: "pipe",
+ env: {
+ ...env,
+ BUN_INSTALL_CACHE_DIR: join(run_dir, ".cache"),
+ },
+ });
+ // The exit code will not be 1 if it panics.
+ expect(await exited).toBe(1);
+});