Skip to content

Commit ea501b6

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
incorporate feedback to Fantom's user guide (facebook#50899)
Summary: Pull Request resolved: facebook#50899 changelog: [internal] making things clearer in the docs for Fantom. Reviewed By: rubennorte Differential Revision: D73580305
1 parent 4207f99 commit ea501b6

1 file changed

Lines changed: 30 additions & 20 deletions

File tree

  • packages/react-native-fantom/__docs__

packages/react-native-fantom/__docs__/README.md

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
[🏠 Home](../../../__docs__/README.md)
44

5+
> [!WARNING]
6+
>
7+
> This is experimental!
8+
>
9+
> We are limiting the scope of the project to just React Native internals for
10+
> now, so we can iterate on it quickly and keep the maintenance costs at bay.
11+
>
12+
> In the future, we might explore providing it for testing library/product code
13+
> internally and externally.
14+
>
15+
> This means tests must live in `packages/react-native`.
16+
517
Fantom is the new **integration testing and benchmarking tool for React
618
Native**.
719

@@ -49,18 +61,6 @@ to test cases that are hard to reproduce manually.
4961

5062
## 🚀 Usage
5163

52-
> [!WARNING]
53-
>
54-
> This is experimental!
55-
>
56-
> We are limiting the scope of the project to just React Native internals for
57-
> now, so we can iterate on it quickly and keep the maintenance costs at bay.
58-
>
59-
> In the future, we might explore providing it for testing library/product code
60-
> internally and externally.
61-
>
62-
> This means tests must live in `packages/react-native`.
63-
6464
Create a file with the `-itest.js` suffix anywhere you would normally create a
6565
Jest unit test file.
6666

@@ -139,11 +139,11 @@ Available pragmas:
139139

140140
#### How is this different from Jest tests?
141141

142-
Fantom runs C++ part of React Native, as well as JavaScript. This makes it
143-
possible to test things related to shadow nodes, layout, events, scheduling, C++
144-
state updates to name a few. The results of Fabric are mounted in a mock UI tree
145-
that can be asserted against and individual mounting instructions can be
146-
inspected.
142+
Fantom runs C++ part of React Native, as well as JavaScript on Hermes VM -
143+
unlike Jest tests that run on V8. This makes it possible to test things related
144+
to shadow nodes, layout, events, scheduling, C++ state updates to name a few.
145+
The results of Fabric are mounted in a mock UI tree that can be asserted against
146+
and individual mounting instructions can be inspected.
147147

148148
You can even test your C++ code. For example, we have
149149
[Fantom tests for the new View Culling optimization](../../react-native/Libraries/Components/ScrollView/__tests__/ScrollView-viewCulling-itest.js),
@@ -179,17 +179,27 @@ Native.
179179

180180
#### Is Fantom ready for production use cases?
181181

182-
Fantom is stable and will not go away. For testing specific to React Native, it
183-
is the recommended solution.
182+
Fantom is a stable and reliable testing framework that is here to stay. If
183+
you're planning to make changes to React or React Native internals, we highly
184+
recommend using Fantom as your go-to testing solution.
184185

185-
For now, it is discouraged to use Fantom for product code testing.
186+
**Important Note:** While Fantom is ideal for testing React and React Native
187+
internals, it is not currently supported for testing application-specific code
188+
in React Native apps. We'll keep you updated on any future developments that may
189+
change this.
186190

187191
#### Where can I find examples of tests?
188192

189193
Look for files with the `-itest.js` suffix to find existing tests. The Fantom
190194
test for its public API ([`Fantom-itest.js`](../src/__tests__/Fantom-itest.js))
191195
has simple examples you can learn from.
192196

197+
#### Are tests executed on Github CI?
198+
199+
Fantom tests are currently tied to Meta's infrastructure and do not run outside
200+
of Meta's CI. We are working on migrating Fantom to Github CI. If you submit a
201+
PR, the tests will run as part of the PR import process.
202+
193203
---
194204

195205
If you have any questions not answered here, please reach out to us.

0 commit comments

Comments
 (0)