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.
Using Jest to mock an AWS S3 call results in Argument of type ‘any’ is not assignable to parameter of type ‘never’
I’m having an issue with a test that tries to mock a an S3 call with Jest.
Is it bad practice to mock private methods when unit testing functions?
I have just started writing unit tests. I understand that testing private functions is bad practice (with exceptions i guess).
However, i have not found any clear information on the following: