From d20aacc41575c237304d2063212daa88e722e1ca Mon Sep 17 00:00:00 2001 From: Elliot Hesp Date: Tue, 4 Jul 2017 09:38:59 +0100 Subject: [PATCH] Update testing.md --- docs/contributing/testing.md | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/docs/contributing/testing.md b/docs/contributing/testing.md index 383062db..f6e76826 100644 --- a/docs/contributing/testing.md +++ b/docs/contributing/testing.md @@ -1,3 +1,55 @@ # Testing +Currently due to the blackbox Firebase enviroment, we have found the best way to test the library is to directly test against the library using a live Firebase project. As some modules also work with the offical web SDK, we can directly compare the results against our own library. This is however restrictive as it doesn't directly test the native code/modules. Plans are in place to overhaul the entire testing setup. +## Running the test app + +For convenience all of the required NPM scripts are packaged with the main library to run the test app. + +### Step 1 - Clone + +```bash +git clone git@github.com:invertase/react-native-firebase.git +``` + +### Step 2 - Install dependencies + +```bash +npm run tests-npm-install +``` + + +### Step 3 - Install [WML](https://github.com/wix/wml) + +WML is a library which copies files & directories to a location. This allows us to copy any changes from the library directly into the tests app, so we can quickly test changes. + +```bash +npm install -g wml +``` + +### Step 4 - Start the watcher + +```bash +npm run tests-watch-init +npm run tests-watch-start +``` + +### Step 5 - Start the app + +```bash +npm run tests-packager +``` + +#### Android + +Open the `tests/android` directory from Android Studio and allow Gradle to sync. Now run the app on an emulator/device. + +#### iOS + +First install the Pods: + +``` +npm run tests-pod-install +``` + +Open the `tests/ios/ReactNativeFirebaseDemo.xcworkspace` file in XCode and build for your preffered device or simulator.