Skip to content

test(coding-agent): add unit tests for stripJsonComments - #525

Open
4sapp wants to merge 1 commit into
dmae97:mainfrom
4sapp:test/523-strip-json-comments
Open

4sapp wants to merge 1 commit into
dmae97:mainfrom
4sapp:test/523-strip-json-comments

Conversation

@4sapp

@4sapp 4sapp commented Nov 24, 2026

Copy link
Copy Markdown

Adds direct Vitest unit tests for stripJsonComments in packages/coding-agent/test/strip-json-comments.test.ts (no source files changed).

Covers:

  • Stripping single-line // comments outside string literals
  • Preserving // inside string literals (such as URLs)
  • Removing trailing commas before ] and }
  • Preserving commas before closing delimiters inside string literals
  • Handling escaped quotes inside strings before //
  • End-of-file comments without trailing newlines and nested objects/arrays

Verification:

  • node ../../node_modules/vitest/dist/cli.js --run test/strip-json-comments.test.ts (7/7 passing)
  • npm run build, tsgo --noEmit, biome check --error-on-warnings ., check:import-cycles, check:module-size, check:private-home passing.

Closes #523

This branch has not been deployed

No deployments
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.

test: add unit tests for stripJsonComments in coding-agent/src/utils/json.ts

1 participant