When it comes to mocking dependencies in Jest, it couldn't be easier. You can create an actual mock module that gets loaded in place of the …
Jest
Testing Event Listeners In Jest (Without Using A Library)
I love using Jest to unit test my Aurelia applications. Sadly, one of the most popular options for mocking event listeners and simulating …
Quick & Easy Way To Reset Mocks & Spies In Jest
When working with mocks and spies in Jest, it is quite easy to fall into a trap where they become stale (especially in cases where pure …
How To Easily Mock Moment.js In Jest
Recently whilst writing some unit tests in Jest, I had to test some code that took ISO date strings and converted them to formatted date …
Jest Not Finding Tests In Travis CI? You Might Be Ignoring The Build Folder
Recently, I encountered an issue in Travis CI and my Aurelia application which uses Jest for the tests suite. I erroneously copied some …