Skip to content

Commit

Permalink
Update Jest-related docs (#355)
Browse files Browse the repository at this point in the history
* Update detox-test CLI --help information

* Update documentation

* Remove edge case flag for xcode debug env
  • Loading branch information
Kureev authored and rotemmiz committed Oct 25, 2017
1 parent dd943ac commit 4aae350
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
23 changes: 11 additions & 12 deletions detox/local-cli/detox-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ const program = require('commander');
const path = require('path');
const cp = require('child_process');
program
.option('-r, --runner [runner]', 'Test runner (currently supports mocha)')
.option('-r, --runner [runner]', 'Test runner (supports mocha and jest)')
.option('-o, --runner-config [config]', 'Test runner config file', 'mocha.opts')
.option('-l, --loglevel [value]', 'info, debug, verbose, silly, wss')
.option('-c, --configuration [device configuration]', 'Select a device configuration from your defined configurations,'
+ 'if not supplied, and there\'s only one configuration, detox will default to it')
.option('-r, --reuse', 'Reuse existing installed app (do not delete and re-install) for a faster run.', false)
.option('-u, --cleanup', 'shutdown simulator when test is over, useful for CI scripts, to make sure detox exists cleanly with no residue', false)
.option('-u, --cleanup', 'Shutdown simulator when test is over, useful for CI scripts, to make sure detox exists cleanly with no residue', false)
.option('-d, --debug-synchronization [value]',
'When an action/expectation takes a significant amount of time use this option to print device synchronization status. '
+ 'The status will be printed if the action takes more than [value]ms to complete')
Expand Down Expand Up @@ -62,14 +62,13 @@ function runJest() {

cp.execSync(command, {
stdio: 'inherit',
env: Object.assign({},
process.env,{
configuration: program.configuration,
loglevel: program.loglevel,
cleanup: program.cleanup,
reuse: program.reuse,
debugSynchronization: program.debugSynchronization,
artifactsLocation: program.artifactsLocation
})
env: Object.assign({}, process.env, {
configuration: program.configuration,
loglevel: program.loglevel,
cleanup: program.cleanup,
reuse: program.reuse,
debugSynchronization: program.debugSynchronization,
artifactsLocation: program.artifactsLocation
})
});
}
}
8 changes: 4 additions & 4 deletions docs/APIRef.DetoxCLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ Initiating your test suite
| Option| Description |
| --- | --- |
| -h, --help | output usage information |
| -r, --runner [runner] | Test runner (currently supports mocha) |
| -r, --runner [runner] | Test runner (supports mocha and jest) |
| -o, --runner-config \<config\> | Test runner config file |
| -l, --loglevel [value] | info, debug, verbose, silly, wss |
| -c, -configuration \<device config\> | Select a device configuration from your defined figurations,if not supplied, and there's only one configuration, detox will default to it |
| -r, --reuse | Reuse existing installed app (do not delete and re-tall) for a faster run. |
| -u, --cleanup | shutdown simulator when test is over, useful for CI ipts, to make sure detox exists cleanly with no residue |
| -u, --cleanup | Shutdown simulator when test is over, useful for CI ipts, to make sure detox exists cleanly with no residue |
| -d, --debug-synchronization \<value\> | When an action/expectation takes a significant amount time use this option to print device synchronization status. The status will be printed if the ion takes more than [value]ms to complete |
| -a, --artifacts-location \<path\> | Artifacts destination path (currently contains only logs). For more details, please check the [Artifacts doc](APIRef.Artifacts.md#artifacts) |
|&#8195;&#8195;&#8195;&#8195;&#8195;&#8195;&#8195;&#8195;&#8195;&#8195;&#8195;&#8195;&#8195;&#8195;&#8195;&#8195;&#8195;&#8195;||



### build
Run a command defined in 'configuration.build'
Expand Down
8 changes: 5 additions & 3 deletions docs/Guide.Jest.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ Add this part to your `package.json`:
"setupTestFrameworkScriptFile": "./e2e/init.js"
},
"scripts": {
"test:e2e": "detox test",
"test:e2e": "detox test -c ios.sim.debug",
"test:e2e:build": "detox build"
},
"detox": {
"runner": "jest",
...
}
```

In the `detox` part of your `package.json`, add `"runner": "jest"` to tell detox that you want to use jest runner instead of mocha.

### Writing Tests

There are some things you should notice:
Expand Down

0 comments on commit 4aae350

Please sign in to comment.