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: website/contributing/contributing-overview.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,7 +123,7 @@ Whenever you are ready to contribute code, check out our [step-by-step guide to
123
123
124
124
### Tests
125
125
126
-
Tests help us prevent regressions from being introduced to the codebase. The GitHub repository is continuously tested using CircleCI and Appveyor, the results of which are available through the Checks functionality on [commits](https://github.com/facebook/react-native/commits/HEAD) and pull requests.
126
+
Tests help us prevent regressions from being introduced to the codebase. The GitHub repository is continuously tested using CircleCI, the results of which are available through the Checks functionality on [commits](https://github.com/facebook/react-native/commits/HEAD) and pull requests.
127
127
128
128
You can learn more about running and writing tests on the [How to Run and Write Tests](/contributing/how-to-run-and-write-tests) page.
Copy file name to clipboardExpand all lines: website/contributing/how-to-build-from-source.md
+8-14Lines changed: 8 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,8 @@ Assuming you have the Android SDK installed, run `android` to open the Android S
12
12
13
13
Make sure you have the following installed:
14
14
15
-
1. Android SDK version 30 (`compileSdkVersion` in [`build.gradle`](https://github.com/facebook/react-native/blob/main/ReactAndroid/build.gradle)).
16
-
2. Android NDK 21.4.7075529 (from in [`gradle.properties`](https://github.com/facebook/react-native/blob/b1120c6a6513ec24568abc6bbe60dd57ef1dec96/gradle.properties#L7), download links and installation instructions below).
15
+
1. Android SDK (find the specific version in the `compileSdkVersion` in [`build.gradle`](https://github.com/facebook/react-native/blob/main/ReactAndroid/build.gradle#L253)).
You can find further instructions on the [official page](https://developer.android.com/ndk/index.html).
54
-
Or follow instructions to [download appropriate NDK from SDK manager](https://developer.android.com/studio/projects/install-ndk#specific-version).
48
+
You can find the instructions to install the NDK on the [official Android NDK website](https://developer.android.com/studio/projects/install-ndk).
55
49
56
50
### Building the source
57
51
@@ -149,9 +143,9 @@ You should be able to use the _Run_ button to run your app on a device. Android
149
143
150
144
### Additional notes
151
145
152
-
Building from source can take a long time, especially for the first build, as it needs to download ~200 MB of artifacts and compile the native code.
146
+
Building from source can take a long time, especially for the first build, as it needs to download ~200 MB of artifacts and compile the native code.
153
147
154
-
Every time you update the `react-native` version from your repo, the build directory may get deleted, and all the files are re-downloaded.
148
+
Every time you update the `react-native` version from your repo, the build directory may get deleted, and all the files are re-downloaded.
155
149
To avoid this, you might want to change your build directory path by editing the `~/.gradle/init.gradle` file:
156
150
157
151
```groovy
@@ -192,7 +186,7 @@ Install it in your app project package.json.
192
186
193
187
## Rationale
194
188
195
-
The recommended approach to working with React Native is to always update to the latest version. No support is provided on older versions and if you run into issues the contributors will always ask you to upgrade to the latest version before even looking at your particular issue.
189
+
The recommended approach to working with React Native is to always update to the latest version. No support is provided on older versions and if you run into issues the contributors will always ask you to upgrade to the latest version before even looking at your particular issue.
196
190
197
191
Sometimes, though, you are temporarily stuck on an older React Native version, but you require some changes from newer versions urgently (bugfixes) without having to do a full upgrade right now. This situation should be short lived by definition and once you have the time, the real solution is to upgrade to the latest version.
198
192
@@ -226,9 +220,9 @@ Upload the binaries from the `android` folder to maven and point your Android ap
226
220
227
221
Instead of uploading to Maven/Nexus, you can add the binaries built in the previous steps to git, by changing the .gitignore and committing the binaries to your forked branch. This allows you to make your fork into a functioning git dependency for React Native app projects.
228
222
229
-
If you have changes that you want to actually merge to React Native, make them on another branch first and open a PR.
223
+
If you have changes that you want to actually merge to React Native, make them on another branch first and open a PR.
230
224
231
-
To start making your dependency branch, make sure you are on a `release/my-forked-release` branch, then merge any commits that you need from yourself or others into this branch.
225
+
To start making your dependency branch, make sure you are on a `release/my-forked-release` branch, then merge any commits that you need from yourself or others into this branch.
232
226
233
227
:::warning
234
228
This release branch should never be merged into any other branch.
Copy file name to clipboardExpand all lines: website/contributing/how-to-contribute-code.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ Then, you can run several commands:
35
35
36
36
Tests help us prevent regressions from being introduced to the codebase. We recommend running `yarn test` or the platform-specific scripts above to make sure you don't introduce any regressions as you work on your change.
37
37
38
-
The GitHub repository is [continuously tested](/contributing/how-to-run-and-write-tests#continuous-testing) using CircleCI and Appveyor, the results of which are available through the Checks functionality on [commits](https://github.com/facebook/react-native/commits/main) and pull requests.
38
+
The GitHub repository is [continuously tested](/contributing/how-to-run-and-write-tests#continuous-testing) using CircleCI, the results of which are available through the Checks functionality on [commits](https://github.com/facebook/react-native/commits/main) and pull requests.
39
39
40
40
You can learn more about running and writing tests on the [How to Run and Write Tests](/contributing/how-to-run-and-write-tests) page.
Copy file name to clipboardExpand all lines: website/contributing/how-to-run-and-write-tests.md
+10-20Lines changed: 10 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,16 +77,7 @@ Finally, make sure end-to-end tests run successfully by executing the following
77
77
./scripts/test-manual-e2e.sh
78
78
```
79
79
80
-
End-to-end tests written in [Detox](https://github.com/wix/Detox) confirm that React Native components and APIs function correctly in the context of a running app. They run the RNTester app in the simulator and simulate a user interacting with the app.
81
-
82
-
You can run Detox end-to-end tests locally by [installing the Detox CLI](https://github.com/wix/Detox/blob/master/docs/Introduction.GettingStarted.md#step-1-install-dependencies) on macOS, then running the following in the command line:
83
-
84
-
```bash
85
-
yarn run build-ios-e2e
86
-
yarn run test-ios-e2e
87
-
```
88
-
89
-
If you work on a component or API that isn't covered by a Detox test, please consider adding one. Detox tests are stored under [`RNTester/e2e/__tests__`](https://github.com/facebook/react-native/tree/main/RNTester/e2e/__tests__).
80
+
This script will make you select to run the RNTester app (that lives within `packages/rn-tester`) or it will generate a fresh new project in `/tmp/RNTestProject`. Follow the step-by-step instructions from the script to test successfully if your changes.
90
81
91
82
## Writing Tests
92
83
@@ -101,11 +92,11 @@ The JavaScript tests can be found inside `__test__` directories, colocated next
101
92
102
93
### iOS Integration Tests
103
94
104
-
React Native provides facilities to make it easier to test integrated components that require both native and JS components to communicate across the bridge.
95
+
React Native provides facilities to make it easier to test integrated components that require both native and JS components to communicate across the bridge.
105
96
106
97
The two main components are `RCTTestRunner` and `RCTTestModule`. `RCTTestRunner` sets up the React Native environment and provides facilities to run the tests as `XCTestCase`s in Xcode (`runTest:module` is the simplest method). `RCTTestModule` is exported to JavaScript as `NativeModules.TestModule`.
107
98
108
-
The tests themselves are written in JS, and must call `TestModule.markTestCompleted()` when they are done, otherwise the test will timeout and fail.
99
+
The tests themselves are written in JS, and must call `TestModule.markTestCompleted()` when they are done, otherwise the test will timeout and fail.
109
100
110
101
Test failures are primarily indicated by throwing a JS exception. It is also possible to test error conditions with `runTest:module:initialProps:expectErrorRegex:` or `runTest:module:initialProps:expectErrorBlock:` which will expect an error to be thrown and verify the error matches the provided criteria.
111
102
@@ -123,11 +114,11 @@ See the following for example usage and integration points:
123
114
124
115
A common type of integration test is the snapshot test. These tests render a component, and verify snapshots of the screen against reference images using `TestModule.verifySnapshot()`, using the [`FBSnapshotTestCase`](https://github.com/facebook/ios-snapshot-test-case) library behind the scenes. Reference images are recorded by setting `recordMode = YES` on the `RCTTestRunner`, then running the tests.
125
116
126
-
Snapshots will differ slightly between 32 and 64 bit, and various OS versions, so it's recommended that you enforce tests are run with the [correct configuration](https://github.com/facebook/react-native/blob/main/scripts/.tests.env).
117
+
Snapshots will differ slightly between 32 and 64 bit, and various OS versions, so it's recommended that you enforce tests are run with the [correct configuration](https://github.com/facebook/react-native/blob/main/scripts/.tests.env).
127
118
128
119
It's also highly recommended that all network data be mocked out, along with other potentially troublesome dependencies. See [`SimpleSnapshotTest`](https://github.com/facebook/react-native/blob/main/IntegrationTests/SimpleSnapshotTest.js) for a basic example.
129
120
130
-
If you make a change that affects a snapshot test in a pull request, such as adding a new example case to one of the examples that is snapshotted, you'll need to re-record the snapshot reference image.
121
+
If you make a change that affects a snapshot test in a pull request, such as adding a new example case to one of the examples that is snapshotted, you'll need to re-record the snapshot reference image.
131
122
132
123
To do this, change `recordMode` flag to `_runner.recordMode = YES;` in [RNTester/RNTesterSnapshotTests.m](https://github.com/facebook/react-native/blob/136666e2e7d2bb8d3d51d599fc1384a2f68c43d3/RNTester/RNTesterIntegrationTests/RNTesterSnapshotTests.m#L29), re-run the failing tests, then flip record back to `NO` and submit/update your pull request and wait to see if the CircleCI build passes.
133
124
@@ -141,29 +132,28 @@ It's a good idea to add an Android integration test whenever you are working on
141
132
142
133
## Continuous Testing
143
134
144
-
We use [Appveyor][config-appveyor] and [CircleCI][config-circleci] to automatically run our open source tests. Appveyor and CircleCI will run these tests whenever a commit is added to a pull request, as a way to help maintainers understand whether a code change introduces a regression. The tests also run on commits to the `main` and `*-stable` branches in order to keep track of the health of these branches.
135
+
We use [CircleCI][config-circleci] to automatically run our open source tests. CircleCI will run these tests whenever a commit is added to a pull request, as a way to help maintainers understand whether a code change introduces a regression. The tests also run on commits to the `main` and `*-stable` branches in order to keep track of the health of these branches.
There's another set of tests that run within Meta's internal test infrastructure. Some of these tests are integration tests defined by internal consumers of React Native (e.g. unit tests for a React Native surface in the Facebook app).
139
+
There's another set of tests that run within Meta's internal test infrastructure. Some of these tests are integration tests defined by internal consumers of React Native (e.g. unit tests for a React Native surface in the Facebook app).
150
140
151
141
These tests run on every commit to the copy of React Native hosted on Facebook's source control. They also run when a pull request is imported to Facebook's source control.
152
142
153
143
If one of these tests fail, you'll need someone at Meta to take a look. Since pull requests can only be imported by Meta employees, whoever imported the pull request should be able to facilitate any details.
154
144
155
145
:::note
156
146
**Running CI tests locally:**
157
-
Most open source collaborators rely on CircleCI and Appveyor to see the results of these tests. If you'd rather verify your changes locally using the same configuration as CircleCI, CircleCI provides a [command line interface](https://circleci.com/docs/2.0/local-cli/) with the ability to run jobs locally.
147
+
Most open source collaborators rely on CircleCI to see the results of these tests. If you'd rather verify your changes locally using the same configuration as CircleCI, CircleCI provides a [command line interface](https://circleci.com/docs/local-cli) with the ability to run jobs locally.
158
148
:::
159
149
160
150
### F.A.Q.
161
151
162
152
#### How do I upgrade the Xcode version used in CI tests?
163
153
164
-
When upgrading to a new version of Xcode, first make sure it is [supported by CircleCI](https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions).
154
+
When upgrading to a new version of Xcode, first make sure it is [supported by CircleCI](https://circleci.com/docs/testing-ios#supported-xcode-versions).
165
155
166
-
You will also need to update the test environment config to make sure tests run on an iOS Simulator that comes installed in the CircleCI machine.
156
+
You will also need to update the test environment config to make sure tests run on an iOS Simulator that comes installed in the CircleCI machine.
167
157
168
158
This can also be found in [CircleCI's Xcode version reference](https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions) by clicking the desired version and looking under Runtimes.
0 commit comments