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
If injectGlobals is set to false, jest-mock-extended doesn't work:
jestisnotdefined
ReferenceError: jestisnotdefinedatcalledWithFn(<userdir>\node_modules\jest-mock-extended\lib\CalledWithFn.js:25:16)
at Object.get (<userdir>\node_modules\jest-mock-extended\lib\Mock.js:90:45)
at mockReset (<userdir>\backend\node_modules\jest-mock-extended\lib\Mock.js:42:17)
The issue is that jest-mock-extended is relying on the global "jest" object to exist.
I tried explicitly adding
import{jest}from'@jest/globals';
but jest-mock-extended uses types from @types/jest which provides different definitions than the ones returned by @jest/globals.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: