Latest post

How to solve window.matchMedia is not a function in Jest

Testing responsive designs in environments that don’t support the matchMedia API, like Jest and jsdom, can be challenging. This necessitates a custom implementation to ensure our React tests can accurately simulate different viewport sizes. Fortunately, the css-mediaquery library provides an API that closely emulates matchMedia, allowing us to create a tailored solution that adheres to Mobile First development principles.

Previous posts