Schalk Neethling
08/04/2022, 9:21 PMTypeError: mock.mockReset is not a function
- I also initially ran into the problem of jest
not being defined but I resolved that with import { jest } from "@jest/globals";
beforeEach(() => {
mockReset(prismaMock);
});
Schalk Neethling
08/05/2022, 6:07 PMnode_modules/jest-mock-extended/lib/Mock.js
on line 56:
// This is a catch for if they pass in a jest.fn()
// Worst case, we will create a jest.fn() (since this is a proxy)
// below in the get and call mockReset on it
if (!mock._isMockObject) {
return mock.mockReset();
}
Schalk Neethling
08/05/2022, 6:38 PMjest-mock-extended
used in the docs but seems it does not support version 28 of Jest:
Could not resolve dependency:
npm ERR! peer jest@"^24.0.0 || ^25.0.0 || ^26.0.0 || ^27.0.0" from jest-mock-extended@2.0.4
Schalk Neethling
08/05/2022, 7:20 PM