picostitch
crafting (and) JavaScript

How Jest Reveals Test Smells

Unfortunately I discover very often when using jest that a lot of the things point me to smells in a test. Jest even encourages some of those instead of encouraging us to write better tests. I found some things over time, so I just collect them here.

jest.mock

jest.fn

jest.setSystemTime() or jest.getRealSystemTime()

Reintroduce this?

Filter tests

Depdenency Injection

Jest Is Slow

Various