Files
2026-08-27 21:09:14 +00:00

18 lines
703 B
TypeScript

import { expect, test } from "bun:test";
import { bunEnv, bunExe } from "harness";
test("parsing npm aliases without package manager does not crash", () => {
// Easiest way to repro this regression with `bunx bunbunbunbunbun@npm:[email protected]`. The package
// doesn't need to exist, we just need `bunx` to parse the package version.
const { stdout, stderr, exitCode } = Bun.spawnSync({
cmd: [bunExe(), "x", "bunbunbunbunbun@npm:[email protected]"],
stdout: "pipe",
stderr: "pipe",
env: bunEnv,
});
expect(exitCode).toBe(1);
expect(stderr.toString()).toContain("error: bunbunbunbunbun@npm:[email protected] failed to resolve");
expect(stdout.toString()).toBe("");
});