mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 04:18:58 +00:00
choose correct resolved package for peer dependencies (#7192)
* fix sometimes failing install test * loop to make sure it happens
This commit is contained in:
@@ -440,30 +440,32 @@ test("it should install with missing bun.lockb, node_modules, and/or cache", asy
|
||||
]);
|
||||
expect(await exited).toBe(0);
|
||||
|
||||
// delete bun.lockb
|
||||
await rm(join(packageDir, "bun.lockb"), { recursive: true, force: true });
|
||||
for (var i = 0; i < 150; i++) {
|
||||
// delete bun.lockb
|
||||
await rm(join(packageDir, "bun.lockb"), { recursive: true, force: true });
|
||||
|
||||
({ stdout, stderr, exited } = spawn({
|
||||
cmd: [bunExe(), "install"],
|
||||
cwd: packageDir,
|
||||
stdout: "pipe",
|
||||
stdin: "pipe",
|
||||
stderr: "pipe",
|
||||
env,
|
||||
}));
|
||||
({ stdout, stderr, exited } = spawn({
|
||||
cmd: [bunExe(), "install"],
|
||||
cwd: packageDir,
|
||||
stdout: "pipe",
|
||||
stdin: "pipe",
|
||||
stderr: "pipe",
|
||||
env,
|
||||
}));
|
||||
|
||||
err = await new Response(stderr).text();
|
||||
out = await new Response(stdout).text();
|
||||
expect(err).toContain("Saved lockfile");
|
||||
expect(err).not.toContain("not found");
|
||||
if (!err.includes("mimalloc: warning")) {
|
||||
expect(err).not.toContain("error:");
|
||||
err = await new Response(stderr).text();
|
||||
out = await new Response(stdout).text();
|
||||
expect(err).toContain("Saved lockfile");
|
||||
expect(err).not.toContain("not found");
|
||||
if (!err.includes("mimalloc: warning")) {
|
||||
expect(err).not.toContain("error:");
|
||||
}
|
||||
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
|
||||
"",
|
||||
expect.stringContaining("Checked 19 installs across 23 packages (no changes)"),
|
||||
]);
|
||||
expect(await exited).toBe(0);
|
||||
}
|
||||
expect(out.replace(/\s*\[[0-9\.]+m?s\]\s*$/, "").split(/\r?\n/)).toEqual([
|
||||
"",
|
||||
expect.stringContaining("Checked 19 installs across 23 packages (no changes)"),
|
||||
]);
|
||||
expect(await exited).toBe(0);
|
||||
|
||||
// delete cache
|
||||
await rm(join(packageDir, "node_modules", ".cache"), { recursive: true, force: true });
|
||||
|
||||
Reference in New Issue
Block a user