Open
Conversation
…l assertions Replace the 'does not throw' test for showNonBillingError with three real tests that verify logWarn/logInfo are called with correct args. Adds coverage for the empty-billingUrl and empty-causes branches. -- qa/dedup-scanner
e69c41d to
88cc613
Compare
Two tests in pull-history.test.ts verified only that cmdPullHistory does not throw when skipping records with no connection info or empty IP. They provided no signal about whether SSH was actually skipped. Add spyOn(Bun, "spawn") assertions to both tests confirming no SSH process is spawned — the critical behavior being tested. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two tests used `if (!result.ok) { expect(result.error.message)... }` after
already asserting `expect(result.ok).toBe(false)`. This creates a pattern
where the inner expect is guarded by a condition the outer expect already
validates — if the outer expect is ever removed, the inner silently becomes
unreachable.
Restructure with `if (result.ok) { throw ... }` to narrow the type for
TypeScript while keeping the error message assertion unconditional.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace bare toHaveBeenCalled()/not.toThrow() assertions that only verified no exception was thrown with real content-checking assertions: - billing-guidance.test.ts: replace "does not throw" with 3 tests verifying logWarn/logInfo are called with correct args (cause list, billing URL, and empty-causes branch) - cmd-status-cov.test.ts: 4 tests now verify JSON output content (state: "unknown" for unsupported clouds, missing server_id, no token; agent filter verifies correct agent in filtered output) - cmd-update-cov.test.ts: "shows manual install command" now checks the output contains npm/bun/install rather than just toHaveBeenCalled - cmd-run-cov.test.ts: "outputs plain text" now checks that the invalid identifier appears in output and JSON is not output - orchestrate-cov.test.ts: "injects model env var" now decodes the base64 env block and verifies AGENT_MODEL is set to the correct value Net: 1 test removed, 2 tests added (billing-guidance). 2014 pass. -- qa/dedup-scanner
…spawn into qa/dedup-scanner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cmd-list-cov.test.tsthat used weaktoHaveBeenCalled()assertions with no content verification, all superseded by stronger tests in the same fileDetails
The removed tests called
cmdList()and only checkedexpect(clack.logInfo).toHaveBeenCalled()orexpect(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"checksmsg.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"checksmsg.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