feat(@joint/mock-svg): Standalone plugin for SVG DOM mocking - #3519
Merged
Merged
Conversation
zbynekstara
requested review from
kumilingus
and
a lite review from Copilot
September 24, 2026 11:31
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Add focused tests for the standalone mocks and correct the documented import examples.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
Adds standalone @joint/mock-svg SVG DOM mocks and updates the Vitest plugin to consume them.
Changes:
- Adds the new package, build configuration, documentation, and mocks.
- Updates the Vitest plugin to use shared mocks.
- Updates workspace metadata and changesets.
| File | Description |
|---|---|
yarn.lock |
Registers workspace dependencies. |
packages/joint-vitest-plugin-mock-svg/README.md |
Documents plugin usage and customization. |
packages/joint-vitest-plugin-mock-svg/package.json |
Adds the standalone mock dependency. |
packages/joint-vitest-plugin-mock-svg/mocks/vite.config.ts |
Externalizes the mock package. |
packages/joint-vitest-plugin-mock-svg/mocks/index.ts |
Imports shared mocks. |
packages/joint-vitest-plugin-mock-svg/.gitignore |
Updates ignored artifacts. |
packages/joint-mock-svg/vite.config.ts |
Configures library builds. |
packages/joint-mock-svg/tsconfig.json |
Configures declarations and type checking. |
packages/joint-mock-svg/src/index.ts |
Implements SVG and ResizeObserver mocks. |
packages/joint-mock-svg/SECURITY.md |
Adds security policy. |
packages/joint-mock-svg/README.md |
Documents standalone package usage. |
packages/joint-mock-svg/package.json |
Defines package metadata and exports. |
packages/joint-mock-svg/LICENSE |
Adds MIT licensing. |
packages/joint-mock-svg/eslint.config.mjs |
Adds lint configuration. |
packages/joint-mock-svg/.gitignore |
Ignores generated artifacts. |
.changeset/olive-moons-repeat.md |
Records the new package release. |
.changeset/afraid-donkeys-invite.md |
Records the Vitest plugin update. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
zbynekstara
requested
a lite review from Copilot
and removed request for
Copilot
September 25, 2026 15:23
Both READMEs carried the MIT text verbatim alongside the LICENSE file next to them, so each package shipped the same legal text twice. Two copies drift: a year, a holder or a future relicence gets changed in one and not the other, and the package then ships two licences that disagree. The LICENSE file stays authoritative, which is what npm always packs and what tooling reads. Both READMEs now link to it with a copyright line, matching core, react, decorators, shapes-general and the rest. The verbatim text was the only instance of its kind in the monorepo, in vitest-plugin-mock-svg, and the new package had inherited it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The mocks were 39 `vi.fn()` calls and are now plain functions, so `expect(el.getBBox).toHaveBeenCalled()` and `getBBox.mockReturnValue()` both stop working. The changeset named the replacement and the migration but not the break, which is the part a reader scanning the changelog needs to see. `minor` stays the right bump: the package is 0.3.1, and a 0.x minor may break. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
kumilingus
approved these changes
Sep 28, 2026
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.



Description
Adds
@joint/mock-svgas a standalone plugin for SVG DOM mocking.Changes
@joint/vitest-plugin-mock-svgto use this plugin as source of truth for the mocks. The mocks in@joint/mock-svgare as close as possible to this original version.