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
+32-32Lines changed: 32 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,43 +6,43 @@ This document provides context for the Gemini code assistant to understand the `
6
6
7
7
`@testing-library/react-native` (RNTL) provides a set of utilities for testing React Native components. It is designed to facilitate writing tests that resemble how users interact with the application, avoiding implementation details.
8
8
9
-
***Core Principle:** "The more your tests resemble the way your software is used, the more confidence they can give you."
10
-
***Tech Stack:** TypeScript, React Native, Jest.
11
-
***Architecture:** The library simulates the React Native runtime on top of `universal-test-renderer`.
9
+
-**Core Principle:** "The more your tests resemble the way your software is used, the more confidence they can give you."
10
+
-**Tech Stack:** TypeScript, React Native, Jest.
11
+
-**Architecture:** The library simulates the React Native runtime on top of `universal-test-renderer`.
12
12
13
13
## Building and Running
14
14
15
15
The project uses `yarn` for dependency management and script execution.
16
16
17
-
***Installation:**`yarn install`
18
-
***Run Tests:**`yarn test` (Runs Jest)
19
-
***Run Tests (CI):**`yarn test:ci` (Runs Jest with worker limits)
-**Validate All:**`yarn validate` (Runs Prettier, ESLint, Typecheck, and Tests in sequence)
24
+
-**Build Project:**`yarn build` (Cleans, builds JS with Babel, builds TS types, and copies Flow types)
25
25
26
26
## Development Conventions
27
27
28
-
***Code Style:**
29
-
***Linting:** ESLint is configured with `@callstack/eslint-config` and `typescript-eslint`. It enforces strict rules, including `no-console` and consistent type imports.
30
-
***Formatting:** Prettier is used for code formatting (single quotes, trailing commas).
31
-
***Imports:** Sorted using `eslint-plugin-simple-import-sort`.
32
-
33
-
***Testing:**
34
-
***Framework:** Jest with `react-native` preset.
35
-
***Location:** Tests are located within `src`, typically in `__tests__` directories or co-located.
36
-
***Setup:**`jest-setup.ts` configures the test environment. `src/index.ts` automatically configures cleanup after each test unless skipped.
37
-
***Coverage:** Collected from `src`, excluding tests.
38
-
39
-
***Commits & Releases:**
40
-
***Commits:** Follow the **Conventional Commits** specification (e.g., `fix:`, `feat:`, `chore:`). This is enforced and used for changelog generation.
41
-
***Releases:** Managed via `release-it`.
42
-
43
-
***File Structure:**
44
-
*`src/`: Source code.
45
-
*`src/pure.ts`: Core logic without side effects (no auto-cleanup).
46
-
*`src/index.ts`: Main entry point, re-exports `pure` and adds side effects (auto-cleanup).
47
-
*`examples/`: Example React Native applications using the library.
48
-
*`website/`: Documentation website.
28
+
-**Code Style:**
29
+
-**Linting:** ESLint is configured with `@callstack/eslint-config` and `typescript-eslint`. It enforces strict rules, including `no-console` and consistent type imports.
30
+
-**Formatting:** Prettier is used for code formatting (single quotes, trailing commas).
31
+
-**Imports:** Sorted using `eslint-plugin-simple-import-sort`.
32
+
33
+
-**Testing:**
34
+
-**Framework:** Jest with `react-native` preset.
35
+
-**Location:** Tests are located within `src`, typically in `__tests__` directories or co-located.
36
+
-**Setup:**`jest-setup.ts` configures the test environment. `src/index.ts` automatically configures cleanup after each test unless skipped.
37
+
-**Coverage:** Collected from `src`, excluding tests.
38
+
39
+
-**Commits & Releases:**
40
+
-**Commits:** Follow the **Conventional Commits** specification (e.g., `fix:`, `feat:`, `chore:`). This is enforced and used for changelog generation.
41
+
-**Releases:** Managed via `release-it`.
42
+
43
+
-**File Structure:**
44
+
-`src/`: Source code.
45
+
-`src/pure.ts`: Core logic without side effects (no auto-cleanup).
46
+
-`src/index.ts`: Main entry point, re-exports `pure` and adds side effects (auto-cleanup).
47
+
-`examples/`: Example React Native applications using the library.
Copy file name to clipboardExpand all lines: website/docs/14.x/docs/api/events/fire-event.mdx
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,11 @@ Use Fire Event for cases not supported by User Event and for triggering event ha
10
10
:::
11
11
12
12
```ts
13
-
function fireEvent(element:ReactTestInstance, eventName:string, ...data:unknown[]):Promise<unknown>;
13
+
function fireEvent(
14
+
element:ReactTestInstance,
15
+
eventName:string,
16
+
...data:unknown[]
17
+
):Promise<unknown>;
14
18
```
15
19
16
20
The `fireEvent` API allows you to trigger all kinds of event handlers on both host and composite components. It will try to invoke a single event handler traversing the component tree bottom-up from passed element and trying to find enabled event handler named `onXxx` when `xxx` is the name of the event passed.
0 commit comments