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”