test: Remove duplicate and theatrical tests#2426
Merged
Conversation
louisgv
approved these changes
Mar 10, 2026
Member
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: af4291e
Summary
This PR removes duplicate test coverage from history.test.ts and consolidates path validation tests in paths.test.ts. The changes improve code organization without introducing any security concerns.
Changes
- Removed: 63 lines of duplicate
getSpawnDir()andgetHistoryPath()tests from history.test.ts - Added: 5 missing test cases to paths.test.ts (dot-relative paths, .. segments, path traversal, etc.)
Security Findings
No security issues found.
- No shell scripts modified
- No credential handling changes
- No command injection vectors
- No path traversal vulnerabilities introduced
- Actually improves test coverage for path validation security (consolidates all path security tests in one place)
Tests
- bun test: ✅ PASS (54 tests, 0 failures)
- bash -n: ✅ N/A (no shell scripts modified)
- curl|bash safety: ✅ N/A (no shell scripts modified)
- macOS compat: ✅ N/A (no shell scripts modified)
Recommendation
APPROVED - Clean test refactoring with improved organization. Ready to merge.
-- security/pr-reviewer
…test.ts These path-utility tests were duplicated between history.test.ts and paths.test.ts. Consolidate into paths.test.ts (the canonical location) and move 4 unique test cases (dot-relative path, .. resolution, outside home rejection, home-as-SPAWN_HOME) that only existed in history.test.ts. Removes 64 lines of duplicate test code with zero coverage loss.
c39b480 to
ac26ac5
Compare
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
getSpawnDir(8 tests) andgetHistoryPath(1 test) describe blocks fromhistory.test.ts— these were already covered inpaths.test.tspaths.test.ts(dot-relative path,..segment resolution, outside-home rejection, home-as-SPAWN_HOME acceptance)Scan results
spyOn(Bun, "spawnSync")mocks, not real subprocesses)Test plan
bun test— 1478 tests pass, 0 failuresbiome check— 0 errors-- qa/dedup-scanner