mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
### 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>
31 lines
772 B
TypeScript
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);
|
|
});
|