Uh oh!
There was an error while loading. Please reload this page.
test: Remove duplicate and theatrical tests - #2539
Merged
Merged
Conversation
Remove redundant existsSync check inside icon-integrity "is actual PNG data" tests — the file existence is already verified in the preceding test, and isPng() will throw if the file is missing. Remove the "should detect multiple dangerous patterns" test from validatePrompt — it retests the same $(…), backtick, ; rm, and |bash/sh patterns that each have their own dedicated it() block immediately above. Fix misleading test description: "should accept scripts with comments containing dangerous patterns" — the test actually expects a throw (documented as a known trade-off). Rename to "should reject…". Removes 1 test (1381 → 1380) and 18 expect() calls. 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: 79e565c
Findings
No security issues found. All changes are deletions of duplicate/redundant test code:
- LOW icon-integrity.test.ts:60,96 — Removed duplicate existsSync() checks (already covered by isPng() which calls readFileSync)
- NONE security.test.ts:267 — Corrected test description from "should accept" to "should reject" (aligns with actual behavior)
- NONE security.test.ts:439-450 — Removed redundant test loop (all patterns already tested individually)
Tests
- bash -n: N/A (no shell scripts modified)
- bun test: PASS (146 tests, 0 failures)
- curl|bash: N/A (no shell scripts)
- macOS compat: N/A (no shell scripts)
Analysis
The PR correctly removes theatrical test code that provides no additional coverage. The removed existsSync() checks were redundant because isPng() already fails if the file doesn't exist. The removed test loop duplicated coverage already provided by individual test cases. The corrected test description improves security documentation by accurately describing that dangerous patterns in comments are intentionally rejected.
-- 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
Remove redundant existsSync check inside icon-integrity "is actual PNG data" tests — the file existence is already verified in the preceding test, and isPng() will throw if the file is missing. Remove the "should detect multiple dangerous patterns" test from validatePrompt — it retests the same $(…), backtick, ; rm, and |bash/sh patterns that each have their own dedicated it() block immediately above. Fix misleading test description: "should accept scripts with comments containing dangerous patterns" — the test actually expects a throw (documented as a known trade-off). Rename to "should reject…". Removes 1 test (1381 → 1380) and 18 expect() calls. 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
Remove redundant existsSync check inside icon-integrity "is actual PNG data" tests — the file existence is already verified in the preceding test, and isPng() will throw if the file is missing. Remove the "should detect multiple dangerous patterns" test from validatePrompt — it retests the same $(…), backtick, ; rm, and |bash/sh patterns that each have their own dedicated it() block immediately above. Fix misleading test description: "should accept scripts with comments containing dangerous patterns" — the test actually expects a throw (documented as a known trade-off). Rename to "should reject…". Removes 1 test (1381 → 1380) and 18 expect() calls. 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
Remove redundant existsSync check inside icon-integrity "is actual PNG data" tests — the file existence is already verified in the preceding test, and isPng() will throw if the file is missing. Remove the "should detect multiple dangerous patterns" test from validatePrompt — it retests the same $(…), backtick, ; rm, and |bash/sh patterns that each have their own dedicated it() block immediately above. Fix misleading test description: "should accept scripts with comments containing dangerous patterns" — the test actually expects a throw (documented as a known trade-off). Rename to "should reject…". Removes 1 test (1381 → 1380) and 18 expect() calls. 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
existsSync(pngPath)check from icon-integrity "is actual PNG data" tests — file existence is already asserted in the precedingit()block, andisPng()throws if the file is missing anywayvalidatePrompt— it retests the same$(…), backtick,; rm, and| bash/shpatterns that each have their own dedicatedit()block immediately aboveRemoves 1 test (1381 → 1380) and 18 expect() calls with no loss of coverage.
-- qa/dedup-scanner