Skip to content

Commit 038f66a

Browse files
committed
docs(testing): describe ns test watch-mode defaults
1 parent fe3d252 commit 038f66a

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

‎content/guide/testing.md‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,8 @@ To execute your test suite in CI make sure to add `--justlaunch`. This parameter
291291
ns test ios --emulator --justlaunch
292292
```
293293

294+
Recent versions of the NativeScript CLI also turn watch mode off automatically when the `CI` or `JENKINS_HOME` environment variable is set, so `ns test` exits once the tests finish.
295+
294296
Each execution of `ns test` consists of the following steps, performed automatically.
295297

296298
1. The CLI starts a Karma server on the development machine.
@@ -306,15 +308,17 @@ Each execution of `ns test` consists of the following steps, performed automatic
306308

307309
The NativeScript can continuously monitor your code for changes and when such changes occur, it can deploy those changes to your testing devices and re-run your tests.
308310

309-
To enable this behavior, run your `ns test` command with the `--watch` flag. For example:
311+
This behavior is on by default: the NativeScript CLI remains active and re-runs tests on code change. To unlock the console, press `Ctrl+C` to stop the process.
312+
313+
To run the tests once and exit instead, pass `--no-watch`:
310314

311315
```bash
312-
ns test android --watch
313-
ns test ios --watch
314-
ns test ios --emulator --watch
316+
ns test android --no-watch
317+
ns test ios --no-watch
318+
ns test ios --emulator --no-watch
315319
```
316320

317-
The NativeScript CLI remains active and re-runs tests on code change. To unlock the console, press `Ctrl+C` to stop the process.
321+
In CI environments (when the `CI` or `JENKINS_HOME` environment variable is set), watch mode is off by default. Pass `--watch` to turn it back on.
318322

319323
#### Configure the Karma Server
320324

0 commit comments

Comments
 (0)