Test design breakpoints using jest and react-testing-library

Test responsive design using jest and react-testing-library

Testing design breakpoints in React applications is an important aspect of front-end development. It ensures that the components look and behave as expected on different screen sizes….

Testing React-Query with Jest and React-testing-library

Testing React-Query with Jest and React-testing-library

Introduction In this article we will cover the basic usage of testing useQuery hook from tanstack/react-query library, along with how to test it using jest and react-testing-library….

Jest.mock is not allowed to reference variables

Jest.mock is not allowed to reference variables

Sometimes when trying to mock a function in Jest, you might encounter the following error: Service mocked with Jest causes “The module factory of jest.mock() is not…

How to mock and test Intl.DateTimeFormat in Jest

How to mock and test Intl.DateTimeFormat in Jest

Intl.DateTimeFormat provides powerful functionalities to format dates. This article demonstrates how to mock and test Intl.DateTimeFormat with Jest. Example Consider we have the following function that does…

testing-react-query-with-mock-service-worker

Testing React-Query with Mock Service Worker

In this article i’ll show you how to test React-Query with Mock Service Worker(MSW). Prerequisites This article will be dependent on a previous articles we published about…

react-query-use-infinite-query-with-jest

Testing Infinite Query With Jest And React-testing-library

In our first article How to test Infinite Query With Jest And React-testing-library, We talked about how to implement React-Query useInfinitieQuery and react-infinite-scroll together to lazy load…

use-infinite-query-hook-infinite-scroll

How to test Infinite Query With Jest And React-testing-library

React-Query is a powerful tool for fetching/caching the data on the frontend side, yet testing React-Query with Jest and React-testing-library might be a bit not straight-forward, in…