Skip to content

test: Remove duplicate and theatrical tests#3089

Open
la14-1 wants to merge 2 commits intomainfrom
qa/dedup-scanner
Open

test: Remove duplicate and theatrical tests#3089
la14-1 wants to merge 2 commits intomainfrom
qa/dedup-scanner

Conversation

@la14-1
Copy link
Copy Markdown
Member

@la14-1 la14-1 commented Mar 29, 2026

Summary

  • Removed 3 theatrical tests from cmd-list-cov.test.ts that used weak toHaveBeenCalled() assertions with no content verification, all superseded by stronger tests in the same file
  • Strengthened 2 remaining cloud-filter tests to verify actual output content

Details

The removed tests called cmdList() and only checked expect(clack.logInfo).toHaveBeenCalled() or expect(consoleMocks.log).toHaveBeenCalled() — these only prove no exception was thrown, not that the function produces correct output.

Each removed test had a stronger equivalent already present in the same file:

  • "shows empty message when no history" (line 106) → "shows no spawns message without filters" checks msg.includes("No spawns recorded")
  • "shows filtered results with agent filter" (line 139) → "shows filtered footer with agent filter" checks actual footer content
  • "shows empty message with agent filter that matches nothing" (line 203) → "shows filter mismatch message with agent filter" checks msg.includes("No spawns found matching")

The 2 retained cloud-filter tests were upgraded from toHaveBeenCalled() to content assertions verifying actual output (server names, error messages).

Net: 3 tests removed, 2 tests strengthened. 1948/1948 tests pass.

-- qa/dedup-scanner

@la14-1 la14-1 force-pushed the qa/dedup-scanner branch from e69c41d to 88cc613 Compare March 29, 2026 08:28
@la14-1
Copy link
Copy Markdown
Member Author

la14-1 commented Mar 30, 2026

Added commit: rename ambiguous duplicate test names across 9 test files.

Multiple test files had identical it() descriptions in different describe blocks. While all tests executed correctly, duplicate names make CI failure output ambiguous.

Files updated: billing-guidance.test.ts, result-helpers.test.ts, do-cov.test.ts, gcp-cov.test.ts, hetzner-cov.test.ts, aws-cov.test.ts, cloud-init.test.ts, ui-utils.test.ts, spawn-skill.test.ts

1974/1974 tests pass.

- update-check.test.ts: fix 3 tests using stale hardcoded version '0.2.3'
  (older than current 0.29.1) to use `pkg.version` so 'should not update
  when up to date' actually tests the current-version path correctly
- run-path-credential-display.test.ts: strengthen weak `toBeDefined()`
  assertion on digitalocean hint to `toContain('Simple cloud hosting')`,
  making it verify the actual fallback hint content

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@la14-1 la14-1 force-pushed the qa/dedup-scanner branch from fd3c783 to 6ccfa04 Compare March 30, 2026 12:43
…rsive-spawn

Two tests in recursive-spawn.test.ts captured console.log output into a
logs array but never asserted against it. Both ended with a comment like
"should not throw" — meaning they only proved the function didn't crash,
not that it produced the right output.

- "shows empty message when no history": now spies on p.log.info and
  asserts cmdTree() emits "No spawn history found."
- "shows flat message when no parent-child relationships": now asserts
  cmdTree() emits "no parent-child relationships" via p.log.info.

expect() call count: 4831 to 4834 (+3 real assertions added).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant