From fba94bbcdbc1dcd9e1b3da4adcf6d85451e3211c Mon Sep 17 00:00:00 2001 From: Claude Bot Date: Mon, 20 Oct 2025 17:47:42 +0000 Subject: [PATCH] Improve alias tests per CodeRabbit review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add verification that skipped packages don't appear in 'bun pm untrusted' output - Add comment explaining that skipScriptsFrom accepts both alias and canonical names This ensures the tests comprehensively verify that skipped packages are not just excluded from the blocked count, but also from the untrusted dependencies list entirely. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../bun-install-lifecycle-scripts.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/cli/install/bun-install-lifecycle-scripts.test.ts b/test/cli/install/bun-install-lifecycle-scripts.test.ts index c2d613710a..979e899c47 100644 --- a/test/cli/install/bun-install-lifecycle-scripts.test.ts +++ b/test/cli/install/bun-install-lifecycle-scripts.test.ts @@ -3016,6 +3016,21 @@ for (const forceWaiterThread of isLinux ? [false, true] : [false]) { expect(await exists(join(depDir, "preinstall.txt"))).toBeFalse(); expect(await exists(join(depDir, "install.txt"))).toBeFalse(); expect(await exists(join(depDir, "postinstall.txt"))).toBeFalse(); + + // Verify skipped packages don't appear in untrusted list + ({ stdout, stderr, exited } = spawn({ + cmd: [bunExe(), "pm", "untrusted"], + cwd: packageDir, + stdout: "pipe", + stderr: "pipe", + env: testEnv, + })); + + out = await stdout.text(); + err = await stderr.text(); + expect(err).not.toContain("error:"); + expect(out).not.toContain("all-lifecycle-scripts"); + expect(await exited).toBe(0); }); test("skipScriptsFrom works with aliased dependencies (default list)", async () => { @@ -3122,6 +3137,7 @@ for (const forceWaiterThread of isLinux ? [false, true] : [false]) { expect(await exists(join(scriptsDir, "prepare.txt"))).toBeTrue(); // prepare always runs }); + // skipScriptsFrom accepts either the dependency alias or canonical package name for flexibility test("skipScriptsFrom by alias name", async () => { const testEnv = forceWaiterThread ? { ...env, BUN_FEATURE_FLAG_FORCE_WAITER_THREAD: "1" } : env; await writeFile(