Open albohlabs opened 2 years ago
I had a similar problem. I was using npm install
. I deleted package-lock.json
, node_modules
and reinstalled with yarn
and it worked for me.
I have a similar issue, can't do jest.mock. Doing global.jest = jest
in setupTests makes it available but jest.mock won't actually mock the methods.
This works for me in jest.setup.js
/* global jest */
global.jest = jest;
Adding global.jest = jest to jest.setup.js ends up introducing weird bugs for me. :(
Facing the same :(
This worked for me:
import { vi } from 'vitest';
and then replace of jest.fn()
with vi.fn()
.
When i try to run
examples/react-app-ts
and reference the globaljest
in the tests an exception is thrown: