--

Great guide, saved precious time.

To anyone trying to DRY this up, you can't put it a `beforeEach` clause. Jest will cache the last value the mock returned. Turns out `mockImplementation` has to be called within the `it` block to avoid this caching.

--

--

Michael T. Andemeskel
Michael T. Andemeskel

Written by Michael T. Andemeskel

I write code and occasionally, bad poetry. Thankfully, my code isn’t as bad as my poetry.

No responses yet