Jest is an industry-standard testing framework for JS projects. It was developed by Facebook to test their code and was made open-source. In this article, I will teach you to create custom Jest matchers to supercharge your testing skills.
read more “Create Custom Jest Matchers to Test Like a Pro”Tag: jest
Advanced testing in React Native with Jest: Redux integration
This post is part of my series on unit testing with Jest in React Native. You can find the introduction here.
By now you should have a solid understanding of how testing works in React Native. But there is one important concept left to go over, that is integrating redux into your tests. Redux is the industry standard for global state management in React applications. Even though React Context is supposed to replace Redux, it is not there yet. So how do we test Redux-connected components with Jest and react-native-testing-library?
read more “Advanced testing in React Native with Jest: Redux integration”Advanced testing in React Native with Jest: Components
This post is part of my series on unit testing with Jest in React Native. You can find the introduction here.
In the previous parts, I went through why unit testing is vital and how to test your components using snapshots. While snapshot testing is effective, it fails to test some aspects of the component. Now I would like to talk about more advanced component testing in react native.
read more “Advanced testing in React Native with Jest: Components”Advanced testing in React Native with Jest: Mocking
This post is part of my series on unit testing with Jest in React Native. You can find the introduction here.
While unit testing your code with Jest, you may come across a time when you have to emulate a certain function. For example, the fetch function that performs HTTP requests, or some hardware-related routines. In such cases, you have to use mocking. Thankfully, jest supports various mocking styles out of the box.
read more “Advanced testing in React Native with Jest: Mocking”Testing React Native apps with Jest
React Native allows developers to develop mobile applications easily, and that means testing is more important than ever. You should test the code you write for a number of reasons, most importantly, to ensure that it actually works. In this article, I will explain some principles of unit testing and show you how it is done in React Native.
read more “Testing React Native apps with Jest”