Skip to content

test: remove duplicate and theatrical tests#3057

Merged
louisgv merged 2 commits intomainfrom
qa/dedup-scanner
Mar 27, 2026
Merged

test: remove duplicate and theatrical tests#3057
louisgv merged 2 commits intomainfrom
qa/dedup-scanner

Conversation

@la14-1
Copy link
Copy Markdown
Member

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

Summary

  • Consolidated 5 near-identical loadManifest rejection tests (manifest.test.ts:220-322) into a single data-driven loop — each tested a different invalid manifest shape but used identical setup/teardown/assertion boilerplate
  • Collapsed 4 identical logInfo/logWarn/logError/logStep smoke tests (ui-cov.test.ts:65-83) into a data-driven loop — all four called a function with a string and checked the output contained that string

Net change: 92 lines removed, 67 added (−25 lines). Test count is unchanged at 1952.

Test plan

  • bun test passes with 1952 tests, 0 failures
  • bunx @biomejs/biome check passes with 0 errors on modified files

-- qa/dedup-scanner

louisgv
louisgv previously approved these changes Mar 27, 2026
Copy link
Copy Markdown
Member

@louisgv louisgv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security Review

Verdict: APPROVED
Commit: 59f8aa7

Findings

No security issues found. This PR refactors test code to reduce duplication using parameterized test loops.

Security Checks

  • ✅ No command injection vectors
  • ✅ No credential handling
  • ✅ No path traversal risks
  • ✅ No injection vulnerabilities (XSS, SQL, etc.)
  • ✅ No unsafe eval/source usage
  • ✅ Test-only changes (no production code impact)

Tests

  • bash -n: N/A (no shell scripts)
  • bun test: PASS (57 tests pass, 0 fail)
  • curl|bash: N/A (no shell scripts)
  • macOS compat: N/A (no shell scripts)

Code Quality

  • Reduces test duplication by converting repetitive cases to parameterized loops
  • Uses satisfies for type safety (complies with no-as policy)
  • Improves maintainability without changing test coverage

-- security/pr-reviewer

@louisgv louisgv added the security-approved Security review approved label Mar 27, 2026
spawn-qa-bot and others added 2 commits March 27, 2026 09:25
Two tests verifying in-memory cache returns the same instance without
re-fetching were duplicated across manifest.test.ts and
manifest-cache-lifecycle.test.ts. The strongest version (checks both object
identity and fetch call count) already lives in the combined-fallback-chain
describe block in manifest-cache-lifecycle.test.ts, so the two weaker
duplicates are removed.

Also fixes missing _resetCacheForTesting() calls in beforeEach for the
in-memory cache behavior and combined fallback chain describe blocks —
without it, in-memory state from a prior test could contaminate later tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Consolidate 5 near-identical manifest rejection tests into a single
data-driven loop, and collapse 4 identical logging-function smoke tests
into a data-driven loop. Both changes eliminate copy-paste repetition
while preserving exact test coverage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@louisgv louisgv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security Review

Verdict: APPROVED
Commit: bd1ec2e10b9e4a49bc11e892d7ee7e4d5a8b7b42

Findings

No security issues found. This PR refactors test code to reduce duplication using parameterized test loops.

Security Checks

  • ✅ No command injection vectors
  • ✅ No credential handling
  • ✅ No path traversal risks
  • ✅ No injection vulnerabilities (XSS, SQL, etc.)
  • ✅ No unsafe eval/source usage
  • ✅ Test-only changes (no production code impact)

Tests

  • bash -n: N/A (no shell scripts)
  • bun test: PASS (57 tests pass, 0 fail)
  • curl|bash: N/A (no shell scripts)
  • macOS compat: N/A (no shell scripts)

Code Quality

  • Reduces test duplication by converting repetitive cases to parameterized loops
  • Uses satisfies for type safety (complies with no-as policy)
  • Improves maintainability without changing test coverage

-- security/pr-reviewer

@louisgv louisgv merged commit e8cf33d into main Mar 27, 2026
5 checks passed
@louisgv louisgv deleted the qa/dedup-scanner branch March 27, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security-approved Security review approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants