You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+41Lines changed: 41 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,3 +53,44 @@ The project uses `yarn` for dependency management and script execution.
53
53
-`src/index.ts`: Main entry point, re-exports `pure` and adds side effects (auto-cleanup).
54
54
-`examples/`: Example React Native applications using the library.
55
55
-`website/`: Documentation website.
56
+
57
+
<skills_system priority="1">
58
+
59
+
## Available Skills
60
+
61
+
<!-- SKILLS_TABLE_START -->
62
+
<usage>
63
+
When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.
64
+
65
+
How to use skills:
66
+
67
+
- Invoke: Bash("openskills read <skill-name>")
68
+
- The skill content will load with detailed instructions on how to complete the task
69
+
- Base directory provided in output for resolving bundled resources (references/, scripts/, assets/)
70
+
71
+
Usage notes:
72
+
73
+
- Only use skills listed in <available_skills> below
74
+
- Do not invoke a skill that is already loaded in your context
75
+
- Each skill invocation is stateless
76
+
</usage>
77
+
78
+
<available_skills>
79
+
80
+
<skill>
81
+
<name>code-review</name>
82
+
<description>Master effective code review practices to provide constructive feedback, catch bugs early, and foster knowledge sharing while maintaining team morale. Use when reviewing pull requests, establishing review standards, or mentoring developers.</description>
83
+
<location>project</location>
84
+
</skill>
85
+
86
+
<skill>
87
+
<name>doc-coauthoring</name>
88
+
<description>Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.</description>
This library has a `peerDependencies` listing for `test-renderer`. Make sure that your `test-renderer` version matches exactly the `react` version, avoid using `^` in version number.
39
+
This library has a `peerDependencies` listing for [Test Renderer](https://github.com/mdjastrzebski/test-renderer). Make sure to install it as a dev dependency:
-[Queries](https://callstack.github.io/react-native-testing-library/docs/api/queries) - find rendered components by various predicates: role, text, test ids, etc
-[Jest matchers](https://callstack.github.io/react-native-testing-library/docs/api/jest-matchers) - validate assumptions about your UI
90
-
-[User Event](https://callstack.github.io/react-native-testing-library/docs/api/events/user-event) - simulate common user interactions like [`press`](https://callstack.github.io/react-native-testing-library/docs/api/events/user-event#press) or [`type`](https://callstack.github.io/react-native-testing-library/docs/user-event#type) in a realistic way
98
+
-[User Event](https://callstack.github.io/react-native-testing-library/docs/api/events/user-event) - simulate common user interactions like [`press`](https://callstack.github.io/react-native-testing-library/docs/api/events/user-event#press) or [`type`](https://callstack.github.io/react-native-testing-library/docs/api/events/user-event#type) in a realistic way
91
99
-[Fire Event](https://callstack.github.io/react-native-testing-library/docs/api/events/fire-event) - simulate any component event in a simplified way
92
100
-[`renderHook` function](https://callstack.github.io/react-native-testing-library/docs/api/misc/render-hook) - render hooks for testing purposes
93
101
- Miscellaneous APIs:
@@ -98,6 +106,7 @@ React Native Testing Library consists of following APIs:
98
106
99
107
## Migration Guides
100
108
109
+
-**[Migration to 14.0](https://callstack.github.io/react-native-testing-library/docs/migration/v14)** - Drops React 18, async APIs by default
101
110
-[Migration to 13.0](https://callstack.github.io/react-native-testing-library/docs/migration/v13)
102
111
-[Migration to built-in Jest Matchers](https://callstack.github.io/react-native-testing-library/docs/migration/jest-matchers)
Copy file name to clipboardExpand all lines: website/docs/14.x/cookbook/basics/async-events.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,18 @@
1
-
# Async tests
1
+
# Async Events
2
2
3
3
## Summary
4
4
5
-
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:
5
+
In RNTL v14, all testsare async since `render()`, `fireEvent()`, and other core APIs return Promises. Beyond the basic async APIs, there are additional async utilities for handling events that complete over time:
6
6
7
-
1.**Testing Code with asynchronous operations**: When your code relies on asynchronous operations, such as network calls or database queries, async tests are essential. Even though you should mock these network calls, the mock should act similarly to the actual behavior and hence by async.
8
-
2.**UserEvent API:** Using the [User Event API](docs/api/events/user-event) in your tests creates more realistic event handling. These interactions introduce delays (even though these are typically event-loop ticks with 0 ms delays), requiring async tests to handle the timing correctly.
7
+
1.**Waiting for elements to appear**: Use `findBy*` queries when elements appear after some delay (e.g., after data fetching).
8
+
2.**Waiting for conditions**: Use `waitFor()` to wait for arbitrary conditions to be met.
9
+
3.**Waiting for elements to disappear**: Use `waitForElementToBeRemoved()` when elements should be removed after some action.
9
10
10
-
Using async tests when needed ensures your tests are reliable and simulate real-world conditions accurately.
11
+
These utilities help you write reliable tests that properly handle timing in your application.
11
12
12
13
### Example
13
14
14
-
Consider a basic asynchronous test for a user signing in with correct credentials:
15
+
Consider a test for a user signing in with correct credentials:
15
16
16
17
```javascript
17
18
test('User can sign in with correct credentials', async () => {
0 commit comments