Relative Content

Tag Archive for typescriptunit-testingjestjs

Jest mock an imported function – it keeps calling the original

I have a function in a module segmentEvents.ts and I want to assert that another function is called when I call the first. The problem is that I am unable to mock the second function to check it’s called. No matter what I do the real implementation of the function is called.