Files
bun.sh/test/cli/install/hoist.test.ts
Dylan Conway 19f21c00bd fix #24510 (#24563)
### What does this PR do?
The assertion was too strict.

This pr changes to assertion to allow multiple of the same dependency id
to be present. Also changes all the assertions to debug assertions.

fixes #24510
### How did you verify your code works?
Manually, and added a new test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Marko Vejnovic <marko@bun.com>
2025-11-14 16:49:21 -08:00

31 lines
772 B
TypeScript

import { afterAll, beforeAll, test } from "bun:test";
import { VerdaccioRegistry, bunEnv, runBunInstall } from "harness";
const registry = new VerdaccioRegistry();
beforeAll(async () => {
await registry.start();
});
afterAll(() => {
registry.stop();
});
test("should handle resolving optional peer from multiple instances of same package", async () => {
const { packageDir } = await registry.createTestDir({
files: {
"package.json": JSON.stringify({
name: "pkg",
dependencies: {
"dep-1": "npm:one-optional-peer-dep@1.0.2",
"dep-2": "npm:one-optional-peer-dep@1.0.2",
"one-dep": "1.0.0",
},
}),
},
});
// this shouldn't hit an assertion
await runBunInstall(bunEnv, packageDir);
});