You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, first of all, thank you for this great library!
I have an existing project that uses Vite, Preact and Jest. This worked fine so far with thanks to @preact/preset-vite. I’m currently adapting the specs to run them with vitest.
I have a simple Preact component that imports memo from preact/compat and a corresponding spec.
Describe the bug
Hello, first of all, thank you for this great library!
I have an existing project that uses Vite, Preact and Jest. This worked fine so far with thanks to @preact/preset-vite. I’m currently adapting the specs to run them with vitest.
I have a simple Preact component that imports
memo
frompreact/compat
and a corresponding spec.See
https://github.com/molily/vitest-test/blob/main/src/MemoMessage.jsx
https://github.com/molily/vitest-test/blob/main/src/MemoMessage.test.jsx
When running vitest, I get this error:
The component spec which does not include
preact/compat
passes (Message.test.jsx).Any ideas why this happens with vitest while vite (dev and prod build) works fine?
My uneducated guess is that vitest clashes with the code transformations in @preact/preset-vite, including @prefresh/vite for HMR. I’ve copied @preact/preset-vite to remove prefresh. See vite-no-prefetch.config.js. But alas,
vitest -c vite-no-prefetch.config.js
throws the same error.I’m happy to forward this problem to the Preact team if there is anything they can do.
Thank you very much! 💖
Reproduction
See:
https://github.com/molily/vitest-test
$ pnpm install
$ npx vitest run
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: