You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Runs the tests in your project in the visionOS Simulator or on connected Apple Vision Pro devices.<% if(isConsole && isMacOS) { %> Your project must already be configured for unit testing with the Vitest framework by running `$ ns test init --framework vitest`.<% } %> Unit testing on visionOS requires the Vitest testing framework; the deprecated Karma-based frameworks are not supported on this platform.
11
+
12
+
<% if(isConsole && (isLinux || isWindows)) { %>WARNING: You can run this command only on macOS systems. To view the complete help for this command, run `$ ns help test visionos`<% } %>
13
+
14
+
### Commands
15
+
16
+
Usage | Synopsis
17
+
------|-------
18
+
Run tests in the visionOS Simulator | `$ ns test visionos`
19
+
Run tests on a selected device | `$ ns test visionos --device <Device ID>`
20
+
21
+
<% if((isConsole && isMacOS) || isHtml) { %>
22
+
23
+
### Options
24
+
25
+
*`--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 `$ ns device`. `<Device ID>` is the device index or identifier as listed by the `$ ns device` command.
26
+
*`--env.codeCoverage` - If set, collects code coverage for the test run.
27
+
*`--force` - If set, skips the application compatibility checks and forces `npm i` to ensure all dependencies are installed. Otherwise, the command will check the application compatibility with the current CLI version and could fail requiring `ns migrate`.
28
+
29
+
<% } %>
30
+
31
+
<% if(isHtml) { %>
32
+
33
+
### Prerequisites
34
+
35
+
* Verify that [you have configured your project for unit testing](test-init.html) with the Vitest framework.
36
+
* Verify that [you have stored your unit tests in `app`→`tests`](http://docs.nativescript.org/testing).
37
+
* Verify that [you have configured your system and devices properly](http://docs.nativescript.org/testing).
38
+
39
+
### Related Commands
40
+
41
+
Command | Description
42
+
--------|------------
43
+
[test init](test-init.html) | Configures your project for unit testing with a selected framework.
44
+
[test android](test-android.html) | Runs the tests in your project on Android devices or native emulators.
45
+
[test ios](test-ios.html) | Runs the tests in your project on iOS devices or the iOS Simulator.
`<Platform>` is the target mobile platform on which you want to run the tests. You can set the following target platforms.
30
30
*`android` - Runs the tests in your project on connected Android devices or Android emulators.
31
-
*`ios` - Runs the tests in your project on connected iOS devices.<% } %>
31
+
*`ios` - Runs the tests in your project on connected iOS devices.
32
+
*`visionos` - Runs the tests in your project in the visionOS Simulator or on connected Apple Vision Pro devices. Requires the Vitest testing framework.<% } %>
32
33
33
34
<% if(isHtml) { %>
34
35
@@ -45,4 +46,5 @@ Command | Description
45
46
[test init](test-init.html) | Configures your project for unit testing with a selected framework.
46
47
[test android](test-android.html) | Runs the tests in your project on Android devices or native emulators.
47
48
[test ios](test-ios.html) | Runs the tests in your project on iOS devices or the iOS Simulator.
49
+
[test visionos](test-visionos.html) | Runs the tests in your project in the visionOS Simulator or on Apple Vision Pro devices.
Copy file name to clipboardExpand all lines: lib/commands/test-init.ts
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -345,14 +345,15 @@ class TestInitCommand implements ICommand {
345
345
constclosingNotes=isVitest
346
346
? [
347
347
color.yellow(
348
-
`Note: emulator/simulator test runs connect over the local loopback. When testing on a physical Android device, keep it connected over USB (adb reverse is set up automatically); for a physical iOS device, pass a reachable 'url' to the coordinator in your test entry.`,
348
+
`Note: emulator/simulator test runs connect over the local loopback. When testing on a physical Android device, keep it connected over USB (adb reverse is set up automatically); for a physical iOS or visionOS device, pass a reachable 'url' to the coordinator in your test entry.`,
349
349
),
350
350
"",
351
351
"",
352
352
`You can now run your tests:`,
353
353
"",
354
354
` ${greyDollarSign}${color.green("ns test ios")}`,
355
355
` ${greyDollarSign}${color.green("ns test android")}`,
356
+
` ${greyDollarSign}${color.green("ns test visionos")}`,
356
357
"",
357
358
`or directly through Vitest (editor extensions, CI):`,
0 commit comments