Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(joint-vitest-plugin-mock-svg): Add new plugin #2863

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

zbynekstara
Copy link
Contributor

@zbynekstara zbynekstara commented Jan 22, 2025

Description

Adds a Vitest plugin to mock SVG global constants required for JointJS testing. Importing this plugin will solve issues such as #2824.

import { defineConfig } from 'vitest/config';
import mockSVG from '@joint/vitest-plugin-mock-svg'

export default defineConfig({
  plugins: [mockSVG()],
})

This PR includes React and Vue E2E tests, which can be run via yarn run test (needs yarn install + yarn run dist on the package + yarn run dist on joint-core).

Note

If you get error Failed to resolve entry for package "@joint/vitest-plugin-mock-svg". The package may have incorrect main/module/exports specified in its package.json. [plugin externalize-deps], it means that you have not run yarn run dist inside the joint-vitest-plugin-mock-svg package. See above for instructions

@zbynekstara zbynekstara marked this pull request as ready for review February 3, 2025 09:47
@zbynekstara zbynekstara changed the title WIP: feat(joint-vite-plugin-mock-svg): Add new plugin feat(joint-vitest-plugin-mock-svg): Add new plugin Feb 3, 2025
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.

1 participant