Open dhardtke opened 1 year ago
It makes a lot of sense for this library to move from @types/jest
to @jest/globals
+ make @jest/globals
a peer dependency.
The only challenge seems to be the jest.Mock
type that changed interface, so this one requires some library changes.
Any reason the fix PR can't be merged? Also affects running with eg. bun
In our project we do not want to enable injection of globals such as
test
,describe
, etc.See https://jestjs.io/docs/cli#--injectglobals
If injectGlobals is set to false, jest-mock-extended doesn't work:
The issue is that jest-mock-extended is relying on the global "jest" object to exist.
I tried explicitly adding
but jest-mock-extended uses types from @types/jest which provides different definitions than the ones returned by @jest/globals.