-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage with Expo instructions #630
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift click to select a range
29cd154
expo 25 instructions
63c83f3
Update Guide.Expo.md
peterpme c52d4eb
Update Guide.Expo.md
peterpme 43684c8
Update Guide.Expo.md
peterpme 4f60f40
Update Guide.Expo.md
peterpme 6c71050
Update Guide.Expo.md
peterpme eed5090
Update Guide.Expo.md
peterpme 436e357
Update Guide.Expo.md
peterpme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,45 @@ | ||
--- | ||
id: Guide.Expo | ||
title: Expo | ||
--- | ||
|
||
## Usage with Expo (iOS) | ||
|
||
- Install `detox` and `detox-expo-helpers` (yarn or npm) | ||
- Add `detox` configuration to [package.json](https://github.com/expo/with-detox-tests/blob/master/package.json#L21-L29): | ||
|
||
```es6 | ||
"detox": { | ||
"configurations": { | ||
"ios.sim": { | ||
"binaryPath": "bin/Exponent.app", | ||
"type": "ios.simulator", | ||
"name": "iPhone 7" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
- Download the Expo app from [Expo.io/tools](https://expo.io/tools). | ||
- Unzip the iOS IPA and **rename the folder** to `Exponent.app`. It'll have a file icon but will still be a folder. | ||
- Create `bin` folder in your project and put `Exponent.app` inside so it matches the binaryPath you set above. | ||
- Create an `e2e` and copy over the settings from [the example app](https://github.com/expo/with-detox-tests/tree/master/e2e) | ||
|
||
The most important piece of this the `reloadApp` from `detox-expo-helpers`. Don't forget this. | ||
|
||
```es6 | ||
const { reloadApp } = require('detox-expo-helpers'); | ||
// ... | ||
beforeEach(async () => { | ||
await reloadApp(); | ||
}); | ||
``` | ||
|
||
That's it! The rest of what you do should be similar to normal detox settings. If you have questions, [tweet @peterpme](https://twitter.com/peterpme) | ||
|
||
## Usage with Expo (Android) | ||
|
||
- We haven't personally tried getting this to work on Android. If you have, feel free to open up a PR! | ||
|
||
### Example App | ||
[expo/with-detox-tests](https://github.com/expo/with-detox-tests) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, is it possible at all to not have to reload the app in between every test? The setup/teardown process adds a fairly significant amount of time to test runs, but when I remove this beforeEach hook from my tests the tests get screwy, so I was wondering if this is just the way it is for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is just the way it has to be for now.