From 6268bdf909f7d27fe5bbe20e4d03f443b1241ad6 Mon Sep 17 00:00:00 2001 From: Zacqary Xeper Date: Wed, 1 Aug 2018 11:25:05 -0400 Subject: [PATCH] Update instructions for Exponent.app 2.x compatibility --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index db4b4d3..f4fed44 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ Utilities for using [detox](http://github.com/wix/detox) in your Expo/Create React Native App apps. +## Dependencies +`detox-expo-helpers` requires your app to use the Expo SDK 29.0.0 or greater. + ## Use it ### Install it @@ -16,6 +19,17 @@ npm i detox-expo-helpers --save-dev Follow the steps in the detox [Getting Started](https://github.com/wix/detox/blob/master/docs/Introduction.GettingStarted.md) guide. +In your `init.js` file, set the `global.__E2E__` flag to `true` before your tests begin, like so: +```js +beforeAll(async () => { + global.__E2E__ = true + await detox.init(config) +}) +``` + +This will tell the Expo client to run in a mode compatible with E2E testing. + + ### Download the Expo app to some directory in your project and configure in package.json You can download the Expo app from the [Expo Tools page](https://expo.io/tools). See an [example package.json configuration](https://github.com/expo/with-detox-tests/blob/033020b165452d641f512a9b1a8a291632ce8e8f/package.json#L21-L29)