From 699df354a95b1eb44cc4f5fb965188270a51ec4d Mon Sep 17 00:00:00 2001 From: A <258483684+la14-1@users.noreply.github.com> Date: Thu, 5 Mar 2026 21:03:07 -0800 Subject: [PATCH] test: Remove duplicate and theatrical tests (#2233) * test: Remove duplicate and theatrical tests - Remove duplicate countImplemented empty-matrix test from manifest-cache-lifecycle.test.ts (already covered in manifest.test.ts) - Remove duplicate agentKeys/cloudKeys empty-manifest test from manifest-cache-lifecycle.test.ts (already covered in manifest.test.ts) - Consolidate gateway-resilience.test.ts from 9 identical startGateway() invocations into 3 grouped tests, reducing redundant async setup overhead while keeping the same assertion coverage (18 expects) - Move stderrSpy.mockRestore() from each it() into afterEach() in gateway-resilience.test.ts -- qa/dedup-scanner * test: Remove dead guards after expect(parsed.success).toBe(true) in icon-integrity Replace v.safeParse + success-check + dead-return guard pattern with v.parse, which throws on invalid input and removes 20 redundant expect() calls and 5 unreachable return statements across agent and cloud icon tests. -- qa/dedup-scanner Co-Authored-By: Claude Sonnet 4.6 --------- Co-authored-by: spawn-qa-bot Co-authored-by: Claude Sonnet 4.6 Co-authored-by: L <6723574+louisgv@users.noreply.github.com> --- .../cli/src/__tests__/icon-integrity.test.ts | 30 ++++--------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/packages/cli/src/__tests__/icon-integrity.test.ts b/packages/cli/src/__tests__/icon-integrity.test.ts index a5db9186..d91a71e3 100644 --- a/packages/cli/src/__tests__/icon-integrity.test.ts +++ b/packages/cli/src/__tests__/icon-integrity.test.ts @@ -61,25 +61,14 @@ describe("Icon Integrity", () => { }); it(`${id} manifest icon URL ends with .png`, () => { - const parsed = v.safeParse(IconEntry, manifest.agents[id]); - expect(parsed.success).toBe(true); - if (!parsed.success) { - return; - } - expect(parsed.output.icon).toEndWith(`${id}.png`); + const parsed = v.parse(IconEntry, manifest.agents[id]); + expect(parsed.icon).toEndWith(`${id}.png`); }); it(`${id} .sources.json ext is "png"`, () => { expect(id in AGENT_SOURCES).toBe(true); - if (!(id in AGENT_SOURCES)) { - return; - } - const parsed = v.safeParse(SourceEntry, AGENT_SOURCES[id]); - expect(parsed.success).toBe(true); - if (!parsed.success) { - return; - } - expect(parsed.output.ext).toBe("png"); + const parsed = v.parse(SourceEntry, AGENT_SOURCES[id]); + expect(parsed.ext).toBe("png"); }); } @@ -114,15 +103,8 @@ describe("Icon Integrity", () => { it(`${id} .sources.json ext is "png"`, () => { expect(id in CLOUD_SOURCES).toBe(true); - if (!(id in CLOUD_SOURCES)) { - return; - } - const src = v.safeParse(SourceEntry, CLOUD_SOURCES[id]); - expect(src.success).toBe(true); - if (!src.success) { - return; - } - expect(src.output.ext).toBe("png"); + const src = v.parse(SourceEntry, CLOUD_SOURCES[id]); + expect(src.ext).toBe("png"); }); }