Repository navigation
Commit 8c389bb
authored
Document when to use Fantom instead of Jest for new tests
Summary:
## Context
New tests for React Native runtime logic should be Fantom tests, but nothing says so. The repository guide lists Jest first as the unit test runner and only says Fantom runs as Android, the Fantom README only asks contributors to "consider" Fantom, and the review guidance accepts either runner "as fits the code". As a result, recent changes added new Jest test files, and new cases to Jest files that already have a Fantom sibling, for code Fantom can run.
## Changes
- Fantom README: add a "Fantom or Jest?" section. Runtime logic (JavaScript that runs in apps using React Native, such as `Libraries` and `src`) gets Fantom tests, including new cases for modules that already have a Jest test. iOS-specific logic and code that runs in Node.js (build tools, scripts, Codegen, Babel and Metro configuration, the CLI, the dev server) use regular Jest. This is the only place the policy is written; the other files link to it.
- `AGENTS.md`: point to that section before adding or extending a JavaScript test, and stop describing Jest as the default unit test runner.
- Code review prompts: describe the test topology with the same split.
Changelog: [Internal]
Differential Revision: D132892213
Pull Request resolved: #601121 parent 23a196d commit 8c389bb
3 files changed
Lines changed: 24 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
| 33 | + | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
| 53 | + | |
| 54 | + | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
62 | 76 | | |
63 | 77 | | |
64 | 78 | | |
| |||
0 commit comments