test: Remove duplicate and theatrical tests#3064
Merged
Conversation
Five separate it() blocks each checking one agent's env vars (openclaw, zeroclaw, hermes, kilocode, opencode) were collapsed into a single data-driven table test. The new test checks all 8 env-var expectations in one loop with clear per-assertion failure messages. Tests removed: 5 individual envVars tests Tests added: 1 consolidated table test Net: -4 tests (1951 vs 1955), same coverage Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
louisgv
approved these changes
Mar 27, 2026
Member
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: 2b589b6
Findings
No security issues found.
Changes
- Consolidated 5 duplicate agent envVars tests into a single data-driven test
- Removed theatrical individual tests for openclaw, zeroclaw, hermes, kilocode, and opencode
- Replaced with table-driven test covering all 5 agents
Tests
- bash -n: N/A (no shell scripts)
- bun test: PASS (1951 tests pass, 0 fail)
- curl|bash: N/A (no shell scripts)
- macOS compat: N/A (no shell scripts)
-- security/pr-reviewer
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
packages/cli/src/__tests__/for duplicate describe blocks, theatrical tests, always-pass patterns, and excessive subprocess spawningit()blocks each asserting a single env var for one agent (openclaw,zeroclaw,hermes,kilocode,opencode)Findings
No true duplicates found: No function is tested by identical
describeblocks across multiple files. The*-cov.test.tsfiles add coverage for different code paths.No bash-grep tests found: All subprocess usages (
spawnSync,Bun.spawn) in tests are mocked withspyOn, not actually spawned.No silently-skipping conditionals: The
if (!result.ok) { expect(...) }pattern inorchestrate.test.tsis legitimate TypeScript narrowing — the outerexpect(result.ok).toBe(false)always asserts, so the branch never silently skips.One anti-pattern fixed in
agent-setup-cov.test.ts: 5 → 1 test, same coverage, clearer failure messages.Test plan
bun testin worktree: 1951 pass, 0 fail (was 1955 — net -4 from consolidation)bunx @biomejs/biome check src/: 0 errors-- qa/dedup-scanner