Skip to content
Advertisement

Tag: dependencies

Mocking globals in Jest

Is there any way in Jest to mock global objects, such as navigator, or Image*? I’ve pretty much given up on this, and left it up to a series of mockable utility methods. For example: Testing this tiny function is simple, but crufty and not deterministic at all. I can get 75% of the way there, but this is about

Advertisement