From 48733b8b912050167fe0c8beb41e6a9e50fab02c Mon Sep 17 00:00:00 2001 From: Seph Soliman Date: Thu, 4 Aug 2022 10:59:06 -0700 Subject: [PATCH 1/3] Fixed pod install instructions Yarn must be run prior to pod install, otherwise pod install fails with "Error: Cannot find module 'mkdirp'" --- website/contributing/how-to-run-and-write-tests.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/website/contributing/how-to-run-and-write-tests.md b/website/contributing/how-to-run-and-write-tests.md index 03bec33016f..4099c8b8326 100644 --- a/website/contributing/how-to-run-and-write-tests.md +++ b/website/contributing/how-to-run-and-write-tests.md @@ -25,11 +25,16 @@ yarn run lint ### iOS Tests -Start off by running `pod install` inside the `RNTester` directory. This will set up your native dependencies and create a `RNTesterPods` Xcode workspace. +Start off by going to the `packages/rn-tester` directory, then: +1. Run `yarn` +2. Run `pod install` (You may have to run `brew install cmake` prior) + +This will set up your native dependencies and create a `RNTesterPods` Xcode workspace. +**Note:** It may take a long time to complete "Installing hermes-engine (1000.0.0)" as it must build Hermes from source. Then, go back to the root of your React Native checkout and run `yarn` followed by `yarn start`. This will set up your JavaScript dependencies. -At this point, you can run iOS tests by invoking the following script from the root of your React Native checkout: +At this point, you can run iOS tests in a new window by invoking the following script from the root of your React Native checkout: ```bash ./scripts/objc-test.sh test From 8445f90777e8a09e73cd6b2915db3f83e7a3adf5 Mon Sep 17 00:00:00 2001 From: Seph Soliman Date: Thu, 4 Aug 2022 11:28:21 -0700 Subject: [PATCH 2/3] yarn start is not necessary anymore --- website/contributing/how-to-run-and-write-tests.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/contributing/how-to-run-and-write-tests.md b/website/contributing/how-to-run-and-write-tests.md index 4099c8b8326..439d30ce25f 100644 --- a/website/contributing/how-to-run-and-write-tests.md +++ b/website/contributing/how-to-run-and-write-tests.md @@ -32,9 +32,9 @@ Start off by going to the `packages/rn-tester` directory, then: This will set up your native dependencies and create a `RNTesterPods` Xcode workspace. **Note:** It may take a long time to complete "Installing hermes-engine (1000.0.0)" as it must build Hermes from source. -Then, go back to the root of your React Native checkout and run `yarn` followed by `yarn start`. This will set up your JavaScript dependencies. +Then, go back to the root of your React Native checkout and run `yarn`. This will set up your JavaScript dependencies. -At this point, you can run iOS tests in a new window by invoking the following script from the root of your React Native checkout: +At this point, you can run iOS tests by invoking the following script from the root of your React Native checkout: ```bash ./scripts/objc-test.sh test From ebe4b521275091339887d44f5bb6f353a3e9b8dd Mon Sep 17 00:00:00 2001 From: Seph Soliman Date: Fri, 5 Aug 2022 17:20:54 -0700 Subject: [PATCH 3/3] Refer to rntester readme --- .../contributing/how-to-run-and-write-tests.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/website/contributing/how-to-run-and-write-tests.md b/website/contributing/how-to-run-and-write-tests.md index 439d30ce25f..94a0a4c4532 100644 --- a/website/contributing/how-to-run-and-write-tests.md +++ b/website/contributing/how-to-run-and-write-tests.md @@ -25,12 +25,7 @@ yarn run lint ### iOS Tests -Start off by going to the `packages/rn-tester` directory, then: -1. Run `yarn` -2. Run `pod install` (You may have to run `brew install cmake` prior) - -This will set up your native dependencies and create a `RNTesterPods` Xcode workspace. -**Note:** It may take a long time to complete "Installing hermes-engine (1000.0.0)" as it must build Hermes from source. +Follow the [README.md](https://github.com/facebook/react-native/blob/main/packages/rn-tester/README.md) instructions in the `packages/rn-tester` directory. Then, go back to the root of your React Native checkout and run `yarn`. This will set up your JavaScript dependencies. @@ -48,6 +43,16 @@ Xcode also allows running individual tests through its Test Navigator. You can a `objc-test.sh` ensures your test environment is set up to run all tests. It also disables tests that are known to be flaky or broken. Keep this in mind when running tests using Xcode. If you see an unexpected failure, see if it's disabled in `objc-test.sh` first. ::: +#### iOS Podfile/Ruby tests + +If you are making modifications to `Podfile` configurations then there are Ruby tests that can verify these. + +To run the ruby tests: +```bash +cd scripts +sh run_ruby_tests.sh +``` + ### Android Tests The Android unit tests do not run in an emulator. They use a normal Java installation. The test suite is built using the [Buck build tool][buck-install].