Uh oh!
There was an error while loading. Please reload this page.
test: Remove duplicate and theatrical tests - #2534
Merged
Merged
Conversation
Consolidate 9 per-credential-type it() blocks in prompt-file-security.test.ts into a single data-driven test covering all 17 sensitive path patterns. Merge 2 validatePromptFileStats "accept" tests into one. Consolidate 4 unicode/encoding-attack it() blocks in security.test.ts into a single data-driven test. Merge 3 "accept identifier" it() blocks into one. Removes 19 redundant tests (1400 → 1381) with no loss of coverage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
louisgv
approved these changes
Mar 12, 2026
louisgv
left a comment
Collaborator
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: 128b228
Findings
No security issues found. This PR refactors test code by consolidating individual test cases into parameterized loops.
Changes reviewed:
packages/cli/src/__tests__/prompt-file-security.test.ts— Consolidated 20+ individual tests into 2 parameterized tests using array-driven casespackages/cli/src/__tests__/security.test.ts— Consolidated encoding attack tests and validation tests into loops
Security analysis:
- ✅ No production code changes — purely test refactoring
- ✅ Test coverage remains comprehensive (103 tests pass)
- ✅ No weakening of security checks
- ✅ No introduction of new attack vectors
- ✅ Improved maintainability through DRY principle
Tests
- bash -n: N/A (no shell scripts)
- bun test: PASS (103 tests pass, 0 fail)
- biome lint: PASS (0 errors)
- curl|bash safety: N/A (test-only changes)
- macOS compat: N/A (test-only changes)
-- security/pr-reviewer
Uh oh!
There was an error while loading. Please reload this page.
AhmedTMM pushed a commit
to AhmedTMM/spawn
that referenced
this pull request
Mar 12, 2026
Consolidate 9 per-credential-type it() blocks in prompt-file-security.test.ts into a single data-driven test covering all 17 sensitive path patterns. Merge 2 validatePromptFileStats "accept" tests into one. Consolidate 4 unicode/encoding-attack it() blocks in security.test.ts into a single data-driven test. Merge 3 "accept identifier" it() blocks into one. Removes 19 redundant tests (1400 → 1381) with no loss of coverage. Co-authored-by: spawn-qa-bot <qa@openrouter.ai> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
AhmedTMM pushed a commit
to AhmedTMM/spawn
that referenced
this pull request
Mar 13, 2026
Consolidate 9 per-credential-type it() blocks in prompt-file-security.test.ts into a single data-driven test covering all 17 sensitive path patterns. Merge 2 validatePromptFileStats "accept" tests into one. Consolidate 4 unicode/encoding-attack it() blocks in security.test.ts into a single data-driven test. Merge 3 "accept identifier" it() blocks into one. Removes 19 redundant tests (1400 → 1381) with no loss of coverage. Co-authored-by: spawn-qa-bot <qa@openrouter.ai> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
5 tasks
AhmedTMM pushed a commit
to AhmedTMM/spawn
that referenced
this pull request
Mar 13, 2026
Consolidate 9 per-credential-type it() blocks in prompt-file-security.test.ts into a single data-driven test covering all 17 sensitive path patterns. Merge 2 validatePromptFileStats "accept" tests into one. Consolidate 4 unicode/encoding-attack it() blocks in security.test.ts into a single data-driven test. Merge 3 "accept identifier" it() blocks into one. Removes 19 redundant tests (1400 → 1381) with no loss of coverage. Co-authored-by: spawn-qa-bot <qa@openrouter.ai> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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 freeto 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
it()blocks inprompt-file-security.test.tsinto a single data-driven test covering all 17 sensitive path patterns ([path, expectedError]pairs)validatePromptFileStats"accept" tests into oneit()blocks insecurity.test.tsinto a single data-driven test using an array of inputs with inline commentsit()blocks into oneRemoves 19 redundant tests (1400 → 1381) with no loss of coverage.
Test plan
bun testpasses: 1381 pass, 0 failbunx @biomejs/biome check src/passes with zero errors-- qa/dedup-scanner