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
{{ message }}
Repository navigation
Unit testing documentation not working because of a breaking change in jest-mock-extended v.2.0.0 #2109
Version 2.00 of jest-mock-extended, which is used in the documentation, contains some breaking changes, the changelog states: Potential backwards compatibility issues for use of mock() where deepMock() may be required. This may result in TS errors.
A quick fix is to just install version 1.0.18 using:
Thanks! But I noticed that the changed docs still don't work for me when using jest-mock-extended 2.0.2-beta2.
import { DeepMockProxy } from "jest-mock-extended/lib/Mock"; gives me the following error: Cannot find module 'jest-mock-extended/lib/Mock' or its corresponding type declarations.
It works when importing from the sub-folder /mjs/: import { DeepMockProxy } from "jest-mock-extended/lib/mjs/Mock";
But maybe it's just some misconfiguration on my side.
Activity
molebox commentedon Aug 9, 2021
Hey @fbennets thanks for this. Im currently talking with another user and came to the same conclusion. Will update the docs today. 🙌
fbennets commentedon Aug 9, 2021
Thanks! But I noticed that the changed docs still don't work for me when using jest-mock-extended 2.0.2-beta2.
import { DeepMockProxy } from "jest-mock-extended/lib/Mock";gives me the following error:Cannot find module 'jest-mock-extended/lib/Mock' or its corresponding type declarations.It works when importing from the sub-folder /mjs/:
import { DeepMockProxy } from "jest-mock-extended/lib/mjs/Mock";But maybe it's just some misconfiguration on my side.