Testing Promises Indirectly with Jest
By Tony Dewan
I recently ran into difficulty creating obvious and readable tests for React components that indirectly rely on promises. I ended up with a handy workaround that allows both native asynchronous and test-friendly synchronous…