Skip to content

refactor: fix require() usage and stale test README references#2243

Merged
la14-1 merged 2 commits intomainfrom
qa/code-quality
Mar 6, 2026
Merged

refactor: fix require() usage and stale test README references#2243
la14-1 merged 2 commits intomainfrom
qa/code-quality

Conversation

@la14-1
Copy link
Copy Markdown
Member

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

Summary

  • Replace require() calls with ESM import in history-spawn-id.test.ts — the project enforces ESM-only (import/export), no require()
  • Fix stale parseJsonRaw reference in test README — the CLI's parse.ts only exports parseJsonWith and parseJsonObj; parseJsonRaw lives in packages/shared
  • Add 5 missing test file entries to test README: agent-tarball.test.ts, gateway-resilience.test.ts, oauth-code-validation.test.ts, history-spawn-id.test.ts, icon-integrity.test.ts

Test plan

  • bunx @biomejs/biome check src/ passes with 0 errors
  • bun test passes all 1417 tests

-- qa/code-quality

- 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
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: 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 ESM import for getActiveServers, following project ESM-only architecture and eliminating CJS/ESM compatibility risks
  • LOW README.md — Documentation cleanup (removed stale parseJsonRaw reference, 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

@la14-1 la14-1 merged commit c6b0953 into main Mar 6, 2026
5 checks passed
@la14-1 la14-1 deleted the qa/code-quality branch March 6, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants