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
looking to mock a function (foo) imported from a module (../foo), for example when using jest:
jest.mock('../foo');// this happens automatically with automockingconstfoo=require('../foo');// foo is a mock functionfoo.mockImplementation(()=>42);foo();// > 42
looking to mock a function (foo) imported from a module (../foo), for example when using jest:
see https://jestjs.io/docs/mock-functions#mock-implementations
I am doing this for an existing codebase that uses ts-mockito, so don't want to throw jest into the mix. :)
The text was updated successfully, but these errors were encountered: