A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://callstack.github.io/react-native-testing-library/docs/guides/faq below:

FAQ - React Native Testing Library

FAQ# Can I test the native features of React Native apps?#

Short answer: no.

React Native Testing Library does not provide an entire React Native runtime since that would require running on a physical device or iOS simulator/Android emulator to provision the underlying OS and platform APIs.

Instead of using React Native renderer, it simulates only the JavaScript part of its runtime using React Test Renderer while providing queries and event APIs (User Event, Fire Event) that mimicking certain behaviors from the actual runtime.

You can learn more about our testing environment here.

This approach has specific benefits and shortfalls. On the positive side:

On the negative side:

The User Event interactions solve some of the simulation issues, as they offer more realistic event handling than the basic Fire Event API.

Should I use/migrate to screen queries?#

There is no need to migrate existing test code to use screen-bases queries. You can still use queries and other functions returned by render. The screen object captures the latest render result.

For new code, you are encouraged to use screen as there are some good reasons for that, which are described in this article by Kent C. Dodds.

Should I use/migrate to User Event interactions?#

We encourage you to migrate existing tests to use the User Event interactions, which offer more realistic event handling than the basic Fire Event API. Hence, it will provide more confidence in the quality of your code.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4