diff --git a/packages/cli/src/__tests__/cmd-link-cov.test.ts b/packages/cli/src/__tests__/cmd-link-cov.test.ts index 72ccc384..c0faaa1e 100644 --- a/packages/cli/src/__tests__/cmd-link-cov.test.ts +++ b/packages/cli/src/__tests__/cmd-link-cov.test.ts @@ -274,23 +274,6 @@ describe("cmdLink (additional coverage)", () => { expect(clack.logError).toHaveBeenCalledWith(expect.stringContaining("not reachable")); }); - it("exits with error when no IP provided", async () => { - const consoleSpy = spyOn(console, "error").mockImplementation(() => {}); - await asyncTryCatch(() => - cmdLink( - [ - "link", - ], - { - tcpCheck: TCP_REACHABLE, - sshCommand: SSH_NO_DETECT, - }, - ), - ); - expect(processExitSpy).toHaveBeenCalledWith(1); - consoleSpy.mockRestore(); - }); - it("exits with error for invalid IP address", async () => { const consoleSpy = spyOn(console, "error").mockImplementation(() => {}); await asyncTryCatch(() => diff --git a/packages/cli/src/__tests__/history.test.ts b/packages/cli/src/__tests__/history.test.ts index 4063a156..f9815f10 100644 --- a/packages/cli/src/__tests__/history.test.ts +++ b/packages/cli/src/__tests__/history.test.ts @@ -60,29 +60,19 @@ describe("history", () => { expect(loadHistory()).toEqual([]); }); - it("returns empty array when file contains a non-array JSON value", () => { - writeFileSync( - join(testDir, "history.json"), + it("returns empty array when file contains an unrecognized JSON value", () => { + // All non-array, non-v1 JSON values hit the same "Unrecognized format" branch + for (const content of [ JSON.stringify({ not: "array", }), - ); - expect(loadHistory()).toEqual([]); - }); - - it("returns empty array when file contains a JSON string", () => { - writeFileSync(join(testDir, "history.json"), JSON.stringify("just a string")); - expect(loadHistory()).toEqual([]); - }); - - it("returns empty array when file contains JSON null", () => { - writeFileSync(join(testDir, "history.json"), "null"); - expect(loadHistory()).toEqual([]); - }); - - it("returns empty array when file contains JSON number", () => { - writeFileSync(join(testDir, "history.json"), "42"); - expect(loadHistory()).toEqual([]); + JSON.stringify("just a string"), + "null", + "42", + ]) { + writeFileSync(join(testDir, "history.json"), content); + expect(loadHistory()).toEqual([]); + } }); it("loads multiple records preserving order", () => { diff --git a/packages/cli/src/__tests__/orchestrate-cov.test.ts b/packages/cli/src/__tests__/orchestrate-cov.test.ts index 694da094..57fc84f1 100644 --- a/packages/cli/src/__tests__/orchestrate-cov.test.ts +++ b/packages/cli/src/__tests__/orchestrate-cov.test.ts @@ -517,22 +517,6 @@ describe("orchestrate SPAWN_NAME", () => { }); }); -// ── preLaunch hooks ─────────────────────────────────────────────────── - -describe("orchestrate preLaunch", () => { - it("calls preLaunch when defined", async () => { - const preLaunch = mock(() => Promise.resolve()); - const cloud = createMockCloud(); - const agent = createMockAgent({ - preLaunch, - }); - - await runSafe(cloud, agent, "testagent"); - - expect(preLaunch).toHaveBeenCalledTimes(1); - }); -}); - // ── tunnel support ──────────────────────────────────────────────────── describe("orchestrate tunnel", () => { diff --git a/packages/cli/src/__tests__/update-check-cov.test.ts b/packages/cli/src/__tests__/update-check-cov.test.ts index 3d0c1e39..83846a6a 100644 --- a/packages/cli/src/__tests__/update-check-cov.test.ts +++ b/packages/cli/src/__tests__/update-check-cov.test.ts @@ -68,22 +68,6 @@ describe("update-check.ts coverage", () => { // ── checkForUpdates skip conditions ──────────────────────────────────── describe("checkForUpdates skip conditions", () => { - it("skips in test environment (NODE_ENV=test)", async () => { - process.env.NODE_ENV = "test"; - global.fetch = mock(async () => new Response("1.0.0")); - const { checkForUpdates } = await import("../update-check"); - await checkForUpdates(); - expect(global.fetch).not.toHaveBeenCalled(); - }); - - it("skips when SPAWN_NO_UPDATE_CHECK=1", async () => { - process.env.SPAWN_NO_UPDATE_CHECK = "1"; - global.fetch = mock(async () => new Response("1.0.0")); - const { checkForUpdates } = await import("../update-check"); - await checkForUpdates(); - expect(global.fetch).not.toHaveBeenCalled(); - }); - it("skips when recently backed off", async () => { writeUpdateFailed(Date.now()); // failed just now global.fetch = mock(async () => new Response("1.0.0"));