Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RiskyMH committed Jan 13, 2025
1 parent d39a490 commit 9f4d303
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/cli/install/bun-pack.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,38 @@ describe("bundledDependnecies", () => {
]);
});

test(`basic should throw`, async () => {
await Promise.all([
write(
join(packageDir, "package.json"),
JSON.stringify({
name: "pack-bundled",
version: "4.4.4",
bundledDependencies: "a",
}),
),
]);

const { stdout, stderr, exited } = Bun.spawn({
cmd: [bunExe(), "pm", "pack"],
cwd: packageDir,
stdout: "pipe",
stderr: "pipe",
stdin: "ignore",
env: bunEnv,
});

const err = await Bun.readableStreamToText(stderr);
expect(err).toContain("error:");
expect(err).toContain("to be an array of strings or boolean");
expect(err).not.toContain("warning:");
expect(err).not.toContain("failed");
expect(err).not.toContain("panic:");

const exitCode = await exited;
expect(exitCode).toBe(1);
});

test("resolve dep of bundled dep", async () => {
// Test that a bundled dep can have it's dependencies resolved without
// needing to add them to `bundledDependencies`. Also test that only
Expand Down

0 comments on commit 9f4d303

Please sign in to comment.