diff --git a/404.html b/404.html index 9ae765b9..c801fae3 100644 --- a/404.html +++ b/404.html @@ -1 +1 @@ -
Typically, you would write synchronous tests, as they are simple and get the work done. However, there are cases when using asynchronous (async) tests might be necessary or beneficial. The two most common cases are:
render functionrender functionRNTL exposes the render function as the primary entry point for tests. If you make complex, repeating setups for your tests, consider creating a custom render function. The idea is to encapsulate common setup steps and test wiring inside a render function suitable for your tests.
This cookbook is intended to showcase best practices, tips & tricks, and ready-to-use recipes for using React Native Testing Library.
We invite you to contribute your favorite recipes to the Cookbook. More info here.
Jotai is a global state management library for React that uses an atomic approach to optimize renders and solve issues like extra re-renders and the need for memoization. It scales from simple diff --git a/docs/advanced/testing-env.html b/docs/advanced/testing-env.html index 44ab3acd..d565b73a 100644 --- a/docs/advanced/testing-env.html +++ b/docs/advanced/testing-env.html @@ -1,4 +1,4 @@ -
This document is intended for a more advanced audience who want to understand the internals of our testing environment better, e.g., to contribute to the codebase. You should be able to write integration or component tests without reading this.
act functionact functionWhen writing RNTL tests one of the things that confuses developers the most are cryptic act() function errors logged into console. In this article I will try to build an understanding of the purpose and behaviour of act() so you can build your tests with more confidence.
act warningsLet’s start with typical act() warnings logged to console. There are two kinds of these issues, let’s call the first one the "sync act()" warning:
React Native Testing Library consists of following APIs:
render function - render your UI components for testing purposesFor common events like press or type it's recommended to use User Event API as it offers
more realistic event simulation by emitting a sequence of events with proper event objects that mimic React Native runtime behavior.
User Event interactions require RNTL v12.2.0 or later.
Built-in Jest matchers require RNTL v12.4.0 or later.
isHiddenFromAccessibilityAlso available as isInaccessible() alias for React Testing Library compatibility.
findBy* queriesThe findBy* queries are used to find elements that are not instantly available but will be added as a result of some asynchronous action. Learn more details here.
waitForconfigure