Wk-notes-11-18-jest-mock
jest api
jest.fn()
function spy, can track how many times the function being calledjest.mock()
can mock a module as imports
[!! Once a module is mocked]: If an exported function in that module is invoked sometime in the test, it MUST be mocked as a jest.fn()
. Otherwise, the function will not be found.
Last updated
Was this helpful?