Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improvements in setup of jest runner. Update GettingStarted documentation. #329

Merged
merged 3 commits into from
Oct 11, 2017
Merged

Improvements in setup of jest runner. Update GettingStarted documentation. #329

merged 3 commits into from
Oct 11, 2017

Conversation

ice-chillios
Copy link
Contributor

@ice-chillios ice-chillios commented Oct 10, 2017

We should probably keep the same patterns with defining E2E test like unit in jest (talking about tests pattern). Also setup can be in one file if we conditionally load detox object. How do you feel about this? :) @DanielMSchmidt

Damian Sznajder and others added 2 commits October 10, 2017 19:54
We should probably keep the same patterns with defining E2E test like unit in jest (talking about __tests__ pattern). Also setup can be in one file if we conditionally load `detox` object. How do you feel about this? :)
@ice-chillios ice-chillios changed the title Improvements in setup of jest runner Improvements in setup of jest runner. Update GettingStarted documentation. Oct 10, 2017
Copy link
Contributor

@DanielMSchmidt DanielMSchmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking the time, I like a lot of this PR!
I added some comments, I hope we can discuss about that ;)

await detox.init(config);
});
// setup detox only when running e2e tests
if (process.argv[2].includes('__e2e__')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed when we specify the setup files, which I think is a cleaner approach

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about one file of setup for all environment (including unit tests). But we can run this file specifically for e2e tests as you mention :)

```

### 4. Run jest

Add this part to your `package.json`:
```json
"jest": {
"preset": "react-native",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this jest config as we run on the build app

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, I had in my mind to create a unified setup for unit and e2e but You are correct, for e2e test we do not need it :)

@@ -19,32 +19,39 @@ You should remove `e2e/mocha.opts`, you no longer need it.
### 3. Write a detox setup file

```js
// ./jest/setup/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this part 👍

"scripts": {
"test:e2e": "jest e2e --setupTestFrameworkScriptFile=./jest/setup-e2e-tests.js --runInBand"
"test:e2e": "detox build && jest __e2e__ --runInBand"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build part is left out because with detox test it isn't included either, but adding something like test:e2e:build: "detox build" is a pretty neat idea!

@ice-chillios
Copy link
Contributor Author

I've applied some changes to this one @DanielMSchmidt. If anything more is bothering You add more notes :)

Copy link
Contributor

@DanielMSchmidt DanielMSchmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you so much for taking the time!

@DanielMSchmidt DanielMSchmidt merged commit 0f10224 into wix:master Oct 11, 2017
@ice-chillios ice-chillios deleted the patch-1 branch October 11, 2017 10:16
@wix wix locked and limited conversation to collaborators Jul 23, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants