From aeafee75e58d9bd06fce1d77b097ca6e59100298 Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Sat, 27 Jun 2026 17:03:55 -0700 Subject: [PATCH] test: remove dead post-await sleeps in skills install tests runSkillsInstall already awaits the spawned child exit event, so the fixed 100ms post-await sleeps were redundant wall-clock time (FN-5048). Removes ~400ms of dead waits; assertions unchanged, 22 tests still pass. --- .../cli/src/commands/__tests__/skills.test.ts | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/packages/cli/src/commands/__tests__/skills.test.ts b/packages/cli/src/commands/__tests__/skills.test.ts index 3196c42fa1..6e660fda6a 100644 --- a/packages/cli/src/commands/__tests__/skills.test.ts +++ b/packages/cli/src/commands/__tests__/skills.test.ts @@ -390,12 +390,16 @@ describe("runSkillsInstall", () => { ); }); + /* + FNXC:CliSkills 2026-06-27-17:10: + runSkillsInstall awaits the spawned child's "exit" event before resolving (skills.ts:193), so + `await runSkillsInstall(...)` already completes after the mock fires exit. The prior fixed 100ms + post-await sleeps were dead wall-clock time (FN-5048: no fixed sleeps where an await already gates + completion); removed without weakening any assertion. + */ it("spawns npx with correct args for install all skills", async () => { await runSkillsInstall(["firebase/agent-skills"]); - // Wait for async spawn to complete - await new Promise((r) => setTimeout(r, 100)); - expect(mocks.spawn).toHaveBeenCalledWith( "npx", ["skills", "add", "firebase/agent-skills", "-y", "-a", "pi"], @@ -406,9 +410,6 @@ describe("runSkillsInstall", () => { it("spawns npx with correct args for specific skill", async () => { await runSkillsInstall(["firebase/agent-skills"], { skill: "firebase-basics" }); - // Wait for async spawn to complete - await new Promise((r) => setTimeout(r, 100)); - expect(mocks.spawn).toHaveBeenCalledWith( "npx", ["skills", "add", "firebase/agent-skills", "--skill", "firebase-basics", "-y", "-a", "pi"], @@ -419,9 +420,6 @@ describe("runSkillsInstall", () => { it("prints success message on successful install", async () => { await runSkillsInstall(["firebase/agent-skills"]); - // Wait for async spawn to complete - await new Promise((r) => setTimeout(r, 100)); - expect(consoleLogSpy).toHaveBeenCalledWith( expect.stringContaining("Installed skill from firebase/agent-skills"), ); @@ -441,9 +439,6 @@ describe("runSkillsInstall", () => { await runSkillsInstall(["firebase/agent-skills"]); - // Wait for async spawn to complete - await new Promise((r) => setTimeout(r, 100)); - expect(consoleErrorSpy).toHaveBeenCalledWith( expect.stringContaining("Failed to install skill"), );