Skip to content

Tag: unit-testing

Mock AWS SES using jest in typeorm

Need to test AWS SES using jest unit testing But showing different errors, also tried solutions in another stackoverflow question The actual code to be tested is : the test file is : Its giving error message as: Answer Actually this mock works, the reason behind the error is that , i didn’t mocked the A…

Module not found even though it is imported

When I run this test: I get this error: Reissue.tsx does import ReissueService. Do I need to mock this and if so how do I do that? In Reissue my import is: and I’m exporting: In ReissueService I export: Answer I changed import { ReissueService } from ‘src/services/ReissueService/ReissueService&#82…

Debugging jest mocks

I’ve got a library that’s giving me some trouble in my jest tests. This library is included throughout my project, and it has an annoyingFunction that has a console.error in it. So, whenever I run a test, I naturally get unwanted console.error messages all over the place. I don’t want to moc…