Closed callmeberzerker closed 2 years ago
I hacked around the issue by setting up my jestconfig.js
preset
with relative path.
export default {
preset: "../../packages/vite-jest/index.js",
setupFilesAfterEnv: ["<rootDir>/src/setupTests.js"],
testMatch: [
"<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}",
"<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}",
],
testEnvironment: "jest-environment-jsdom",
verbose: true,
};
Also could be https://github.com/sodatea/vite-jest/pull/16/files if your stuck.
I had the same issue. I changed the preset
value in jest.config.js to
preset: "./node_modules/vite-jest/index.js",
And was able to get a bit further (before encountering a new issue 😅)
@mjfwebb your answer fixed my situation. was getting vite-jest not found until using the relative path.
Hi there,
I've tried to use
vite-jest
on a small demo project and it failed with the same error I get when I try to run the examplestest:unit
script... It might be someWindows
paths shenanigans but I am not sure...Both projects (
react-app-ts
andreact-app-type-module
) successfully bundle (prod mode) and start inDEV
mode.If there is anything I can do to help, holla at me.
The error log:
Sys info: