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

Support for SvelteKit projects #15

Open
rossyman opened this issue Jul 28, 2021 · 2 comments
Open

Support for SvelteKit projects #15

rossyman opened this issue Jul 28, 2021 · 2 comments

Comments

@rossyman
Copy link

As it stands, Vite-Jest has baked in support for React and Vue. See here:

https://github.com/sodatea/vite-jest/blob/6cb71219d13dfced3dbb0a2a6df3e437d80d9849/packages/vite-jest/jest-preset.js#L7

Myself and @FractalHQ are working on an "adder" that enables developers to introduce Jest tests to their SvelteKit project. We've recently encountered a similar issue to that faced by Vue and React developers, relating to Jest/Vite nuances. See here:

We've got a similar discussion going on in our repo, relating to us utilising vite-jest in our adder:

The two key points I'd like to address, are the following:

  • What changes would be needed to add svelte support to vite-jest (Relating to transformers, etc)
  • Are there any limitations that prevent us from applying vite-jest to svelte, due to the nature of how .svelte components are created?
  • Would we need to do these changes in co-ordination with another transformer such as svelte-jester to ensure that the .svelte extension is correctly transformed.
@benmccann
Copy link
Contributor

Perhaps this list should match the list that's in Vite itself? https://github.com/vitejs/vite/pull/3128/files#diff-071a32aedd2ea59472ebb69fb456e818b103d1a332da632e12c2d54395938ad1L109

@dominikg has a PR open to make the list more configurable in Vite core vitejs/vite#3828

@benmccann
Copy link
Contributor

The import.meta issue is also mentioned in #14

#17 is a bit different, but also related to ESM vs non-ESM code (the error message in that one is Cannot use import statement outside a module)

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

No branches or pull requests

2 participants