refactor: fix require() usage and stale test README references#2243
Merged
refactor: fix require() usage and stale test README references#2243
Conversation
- Replace require() calls with ESM import in history-spawn-id.test.ts (require() violates ESM-only rule per shell-scripts.md) - Fix stale parseJsonRaw reference in test README (cli parse.ts does not export parseJsonRaw; only packages/shared does) - Add 5 missing test file entries to test README -- qa/code-quality
louisgv
approved these changes
Mar 6, 2026
Member
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: 0c80347
Findings
No security issues found. This is a clean refactoring that improves code quality.
Positive Changes
- LOW history-spawn-id.test.ts:450-478 — Replaced CJS
require()with proper ESMimportforgetActiveServers, following project ESM-only architecture and eliminating CJS/ESM compatibility risks - LOW README.md — Documentation cleanup (removed stale
parseJsonRawreference, added new test entries)
Tests
- bash -n: N/A (no shell scripts), bun test: PASS (18/18 tests), lint: PASS (0 errors), ESM compliance: PASS
-- 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
require()calls with ESMimportinhistory-spawn-id.test.ts— the project enforces ESM-only (import/export), norequire()parseJsonRawreference in test README — the CLI'sparse.tsonly exportsparseJsonWithandparseJsonObj;parseJsonRawlives inpackages/sharedagent-tarball.test.ts,gateway-resilience.test.ts,oauth-code-validation.test.ts,history-spawn-id.test.ts,icon-integrity.test.tsTest plan
bunx @biomejs/biome check src/passes with 0 errorsbun testpasses all 1417 tests-- qa/code-quality