Skip to content

Commit 720477a

Browse files
Add help for dev-test-* commands
As the current workflow of unit-testing is: 1) user calls `tns test android` 2) CLI starts a new process in which `tns dev-test android` is called 3) In case the dev-test command fails, the error is caught in the child process and command help is printed on the terminal directly in it. 4) User receives message: `Unable to find command dev-test|android` (from the child process) as we do not have help for this commands. Copy-paste the help fo test-android and test-ios commands and change the filenames so when the child process fails, it will print correct help. Parent process will not fail as the error is caught inside the child, so there's no way to print the help twice. Update common-lib to search dev-commands as well when searching for help pages.
1 parent ec1b2c6 commit 720477a

File tree

3 files changed

+68
-1
lines changed

3 files changed

+68
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
test android
2+
==========
3+
4+
Usage | Synopsis
5+
------|-------
6+
Run tests on all connected devices | `$ tns test android [--watch] [--debug-brk]`
7+
Run tests on a selected device | `$ tns test android --device <Device ID> [--watch] [--debug-brk]`
8+
9+
Runs the tests in your project on connected Android devices and running native emulators.<% if(isConsole) { %> Your project must already be configured for unit testing by running `$ tns test init`.<% } %>
10+
11+
### Options
12+
* `--watch` - If set, when you save changes to the project, changes are automatically synchronized to the connected device and tests are re-run.
13+
* `--device` - Specifies the serial number or the index of the connected device on which to run the tests. To list all connected devices, grouped by platform, run `$ tns device`
14+
* `--debug-brk` - Runs the tests under the debugger. The debugger will break just before your tests are executed, so you have a chance to place breakpoints.
15+
16+
### Attributes
17+
* `<Device ID>` is the device index or identifier as listed by `$ tns device`
18+
19+
<% if(isHtml) { %>
20+
### Prerequisites
21+
22+
* Verify that [you have configured your project for unit testing](test-init.html).
23+
* Verify that [you have stored your unit tests in `app` &#8594; `tests`](http://docs.nativescript.org/testing).
24+
* Verify that [you have configured your system and devices properly](http://docs.nativescript.org/testing).
25+
26+
### Related Commands
27+
Command | Description
28+
--------|------------
29+
[test init](test-init.html) | Configures your project for unit testing with a selected framework.
30+
[test ios](test-ios.html) | Runs the tests in your project on iOS devices or the iOS Simulator.
31+
<% } %>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
test ios
2+
==========
3+
4+
Usage | Synopsis
5+
------|-------
6+
Run tests on all connected devices | `$ tns test ios [--watch] [--debug-brk]`
7+
Run tests on a selected device | `$ tns test ios --device <Device ID> [--watch] [--debug-brk]`
8+
Run tests in the iOS Simulator | `$ tns test ios --emulator [--watch] [--debug-brk]`
9+
10+
Runs the tests in your project on connected iOS devices or the iOS Simulator.<% if(isConsole && isMacOS) { %> Your project must already be configured for unit testing by running `$ tns test init`.<% } %>
11+
12+
<% if(isConsole && (isLinux || isWindows)) { %>WARNING: You can run this command only on OS X systems. To view the complete help for this command, run `$ tns help test ios`<% } %>
13+
14+
<% if((isConsole && isMacOS) || isHtml) { %>
15+
### Options
16+
* `--watch` - If set, when you save changes to the project, changes are automatically synchronized to the connected device and tests are re-ran.
17+
* `--device` - Specifies the serial number or the index of the connected device on which you want to run tests. To list all connected devices, grouped by platform, run `$ tns device`. You cannot set `--device` and `--emulator` simultaneously.
18+
* `--emulator` - Runs tests on the iOS Simulator. You cannot set `--device` and `--emulator` simultaneously.
19+
* `--debug-brk` - Runs the tests under the debugger. The debugger will break just before your tests are executed, so you have a chance to place breakpoints.
20+
21+
### Attributes
22+
* `<Device ID>` is the device index or identifier as listed by `$ tns device`<% } %>
23+
24+
<% if(isHtml) { %>
25+
### Prerequisites
26+
27+
* Verify that [you have configured your project for unit testing](test-init.html).
28+
* Verify that [you have stored your unit tests in `app` &#8594; `tests`](http://docs.nativescript.org/testing).
29+
* Verify that [you have configured your system and devices properly](http://docs.nativescript.org/testing).
30+
31+
### Related Commands
32+
Command | Description
33+
--------|------------
34+
[test init](test-init.html) | Configures your project for unit testing with a selected framework.
35+
[test android](test-android.html) | Runs the tests in your project on Android devices or native emulators.
36+
<% } %>

lib/common

0 commit comments

Comments
 (0)