import fetchMock from 'jest-fetch-mock';
fetchMock.mock...
// -------^
// Property 'mock' does not exist on type 'FetchMock'
The issue is this
I'm using @jest/globals instead of @types/jest in my setup.
The other packages I use all removed @types/jest so now it's no longer in the node_modules folder.
jest-fetch-mock doesn't list @types/jest as a dependency.
Any chance for a fix so jest-fetch-mock works out of the box?
I see two solutions.
Add @types/jest to the dependencies.
Switch to @jest/globals and add it to the dependencies.
Nice solution here. Just adding one of the above type packages to my dependencies fixes a very confusing problem where typescript was red but the tests were green.
I just encountered this error.
The issue is this![image](https://github.com/jefflau/jest-fetch-mock/assets/1266245/e46f335d-90a6-4956-9be8-95472d1b9b8f)
I'm using
@jest/globals
instead of@types/jest
in my setup. The other packages I use all removed@types/jest
so now it's no longer in thenode_modules
folder.jest-fetch-mock
doesn't list@types/jest
as a dependency.Any chance for a fix so
jest-fetch-mock
works out of the box? I see two solutions.@types/jest
to the dependencies.@jest/globals
and add it to the dependencies.The latter seems more futureproof.