Open tomlla opened 2 years ago
The errors here are because that I added some default options to the vite server but didn't realize they are Vue-3 only.
But there are some other issues that prevent vite-jest from supporting the vue2 plugin🤔 I'll take a look.
Would be cool to see this fixed :eyes:
Hi, is there any update on this?
Hey @haug1 and @nagisaando, had the same problem, discovered vitest. With a little rewrite, works like a charm with vue2 + vite 🥳
@tomdevelops I am interested in using Vitest but it's just not production ready yet, and that bothers me a bit.😅 Hopefully they will be ready soon tho.
@tomdevelops How did you get it working? I use Laravel 9 / Vue2 / Vite. My tests w/ vitest all throw (e.g.) "captialize is not a function" for simple function import/exports. However import/export works fine with objects & constants.
export function capitalize(str) {
return str ? str.charAt(0).toUpperCase() + str.slice(1) : str
}
import {capitalize} from "@utils";
I also tried with jest, but I get Cannot use import.meta outside a module
.
If Vite + Vue2 is not vite-jest support target, I'll close this issue.
I got this error when I run vite-jest
My environment