Skip to content

Vitest aliases, fix test file URLs, and add Pointer/RFC6902 tests#279

Open
MarcusLongmuir wants to merge 1 commit intomainfrom
codex/check-and-improve-test-coverage
Open

Vitest aliases, fix test file URLs, and add Pointer/RFC6902 tests#279
MarcusLongmuir wants to merge 1 commit intomainfrom
codex/check-and-improve-test-coverage

Conversation

@MarcusLongmuir
Copy link
Copy Markdown
Collaborator

Motivation

  • Ensure in-repo packages resolve correctly when running Vitest by adding explicit path aliases to the test configs.
  • Correct test fixtures that use file URLs so they use a proper file:/// URL form expected by the code.
  • Improve coverage for JSON Pointer and RFC6902 patch handling by adding unit tests that exercise arrays, objects, cloning semantics and error cases.

Description

  • Added resolve.alias entries to vitest.config.ts in packages/mml-cli and packages/networked-dom-document using node:path to map internal package names to their src/index.ts files for correct module resolution in tests.
  • Replaced "file://test.html" with "file:///test.html" across numerous test files to use a canonical file URL form.
  • Expanded tests in networked-dom-document including new cases in rfc6902/patch.test.ts (add/remove/replace/move/copy/test/invalid ops) and rfc6902/pointer.test.ts (root pointer, invalid pointers, escaping, prototype poisoning, no-op set, push/add semantics), and updated various e2e and v0.1/v0.2 tests to use the corrected file URL.

Testing

  • Ran the repository test suite via Vitest across packages (run via the monorepo test command), including the newly added pointer and RFC6902 tests, and they completed successfully.
  • Coverage configuration remains unchanged and continues to produce lcov reports in the coverage directories.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant