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
import createFetchMock from 'vitest-fetch-mock';
import { vi } from 'vitest';
const fetchMocker = createFetchMock(vi);
// sets globalThis.fetch and globalThis.fetchMock to our mocked version
fetchMocker.enableMocks();
I have omitted any non relevant informations from my package.json I think, let me know if i have to provide other info.
The text was updated successfully, but these errors were encountered:
Thanks for the report. Would you mind creating a new repository with a minimal reproduction of the issue you're seeing here, so that we can clone it and investigate?
However, one thing I do notice is that you've got a typo in your tsconfig.json. The name of the package is vitest-fetch-mock not vitest-fetch-mocks.
That said, I wouldn't expect you to have to add anything to types, since everything in node_modules usually will be picked up automatically, unless you change typeRoots. So yeah, I think we'd need a reproduction to investigate further.
Running
npm run build
on my project fire many of those errors:I cannot add to my tsconfig.json types because of
Cannot find type definition file for 'vitest-fetch-mocks'.
:The solution was to add an ignore comment before every line:
Do you have same errors?
My env is composed as follow:
I setup my tests using:
And my setup contains:
I have omitted any non relevant informations from my package.json I think, let me know if i have to provide other info.
The text was updated successfully, but these errors were encountered: