Hey All, I am following the example here <https://...
# orm-help
s
Hey All, I am following the example here https://www.prisma.io/docs/guides/testing/unit-testing#singleton but when running the tests I am getting
TypeError: 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";
Copy code
beforeEach(() => {
  mockReset(prismaMock);
});
I have now come to realise that the error is happening in
node_modules/jest-mock-extended/lib/Mock.js
on line 56:
Copy code
// 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();
}
Hmm, just tried to install the same version of
jest-mock-extended
used in the docs but seems it does not support version 28 of Jest:
Copy code
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