tns test ios
Description
Runs the tests in your project on connected iOS devices or the iOS Simulator. Your project must already be configured for unit testing by running $ tns test init.
WARNING: You can run this command only on macOS systems. To view the complete help for this command, run $ tns help test ios
Commands
| Usage | Synopsis |
|---|---|
| Run tests on all connected devices | $ tns test ios [--watch] [--debug-brk] |
| Run tests on a selected device | $ tns test ios --device <Device ID> [--watch] [--debug-brk] |
| Run tests in the iOS Simulator | $ tns test ios --emulator [--watch] [--debug-brk] |
Options
-
--watch- If set, when you save changes to the project, changes are automatically synchronized to the connected device and tests are re-ran. -
--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--deviceand--emulatorsimultaneously.<Device ID>is the device index or identifier as listed by the$ tns devicecommand. -
--emulator- Runs tests on the iOS Simulator. You cannot set--deviceand--emulatorsimultaneously. -
--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. -
--force- If set, skips the application compatibility checks and forcesnpm ito ensure all dependencies are installed. Otherwise, the command will check the application compatibility with the current CLI version and could fail requiringtns migrate.
Prerequisites
- Verify that you have configured your project for unit testing.
- Verify that you have stored your unit tests in
app→tests. - Verify that you have configured your system and devices properly.
Related Commands
| Command | Description |
|---|---|
| test init | Configures your project for unit testing with a selected framework. |
| test android | Runs the tests in your project on Android devices or native emulators. |