GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: support vitest unit tests by NathanWalker · Pull Request #6123 · NativeScript/nativescript-cli

Conversation

@NathanWalker

@NathanWalker NathanWalker commented Aug 8, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Support Vitest as first class default option on unit testing. Other options are still options as well on init.
Companion for NativeScript/nativescript-unit-test-runner#80

Summary by CodeRabbit

  • New Features

    • Added Vitest support for project initialization and test execution.
    • Enabled NativeScript unit and UI testing on Android, iOS, and visionOS devices.
    • Added platform, device, and coverage options for Vitest runs.
    • Added sample Vitest configurations and test templates.
    • Added framework-specific dependency installation support.
  • Documentation

    • Documented Vitest as the recommended testing framework.
    • Added visionOS testing commands and guidance.
    • Marked Karma-based testing frameworks as deprecated.
  • Bug Fixes

    • Improved Android test connectivity through local WebSocket network configuration.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@NathanWalker
feat: support vitest unit tests
51352d9
@NathanWalker
NathanWalker requested a review from edusperoni August 8, 2026 04:03
@coderabbitai

coderabbitai Bot commented Aug 8, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The CLI now supports Vitest initialization and execution for NativeScript runtime, UI, and visionOS tests. It adds dependencies, resources, Android network configuration, framework detection, command routing, and documentation while preserving the Karma flow with deprecation notices.

Changes

Vitest testing integration

Layer / File(s) Summary
Framework contracts and dependency selection
config/test-dependencies.json, lib/constants.ts, lib/common/declarations.d.ts, lib/definitions/project.d.ts, lib/services/test-initialization-service.ts
Vitest is added as a supported framework. Dependency metadata supports multiple frameworks and native packages in dependencies. The Vitest execution service contract is defined.
Vitest project initialization
lib/commands/test-init.ts, resources/test/*, docs/man_pages/project/testing/*
Initialization creates Vitest configuration, entrypoints, sample tests, Android network security settings, and framework-specific instructions. Documentation adds visionOS testing.
Vitest test execution
lib/bootstrap.ts, lib/commands/test.ts, lib/services/vitest-execution-service.ts
Vitest projects use readiness checks and platform-specific Vitest execution. The test visionos command is enabled. Karma projects retain their existing flow and receive deprecation warnings.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TestCommandBase
  participant VitestExecutionService
  participant Vitest
  TestCommandBase->>VitestExecutionService: detect project and validate readiness
  VitestExecutionService->>Vitest: start platform-specific non-watch run
  Vitest-->>VitestExecutionService: return process status
  VitestExecutionService-->>TestCommandBase: complete or report failure
Loading

Possibly related PRs

  • NativeScript/nativescript-cli#6094: Both PRs introduce Vitest support in nativescript-cli; this PR targets NativeScript project and device testing.

Suggested reviewers: edusperoni

Poem

I hop through Vitest paths with cheer,
NativeScript tests now start clear.
WebSockets cross the local night,
VisionOS runs come into sight.
Karma waits while new tests glow.
Squeak, said the rabbit, ship it so!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the pull request's main change: adding Vitest unit-test support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

coderabbitai[bot]
coderabbitai Bot reviewed Aug 8, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@config/test-dependencies.json`:
- Around line 3-22: Regenerate the generated dependency registry from
config/test-dependencies.json using scripts/generate-test-deps.js, and include
the resulting config/test-deps-versions-generated.json with entries for vitest,
`@vitest/runner`, `@nativescript/unit-test-runner`, and
`@valor/nativescript-websockets` so ns test init --framework vitest can resolve
them.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cbfc56e8-3737-417e-9205-85df7cbd4fbd

📥 Commits

Reviewing files that changed from the base of the PR and between 9322fdc and 51352d9.

📒 Files selected for processing (16)
  • config/test-dependencies.json
  • docs/man_pages/project/testing/test-init.md
  • lib/bootstrap.ts
  • lib/commands/test-init.ts
  • lib/commands/test.ts
  • lib/common/declarations.d.ts
  • lib/constants.ts
  • lib/definitions/project.d.ts
  • lib/services/test-initialization-service.ts
  • lib/services/vitest-execution-service.ts
  • resources/test/example.vitest.js
  • resources/test/example.vitest.ts
  • resources/test/network_security.xml
  • resources/test/test-main.vitest.js
  • resources/test/test-main.vitest.ts
  • resources/test/vitest.config.mts

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread config/test-dependencies.json Resolved

Uh oh!

There was an error while loading. Please reload this page.

triniwiz
triniwiz approved these changes Aug 8, 2026
View reviewed changes
@NathanWalker
chore: visionos support for unit testing with vitest
764e577
coderabbitai[bot]
coderabbitai Bot reviewed Aug 8, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/man_pages/project/testing/test-visionos.md`:
- Line 46: Insert a blank line immediately before the `<% } %>` template
directive in the Markdown table section so the table is terminated before the
directive and markdownlint MD056 no longer treats it as a table row.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 10473ce5-0101-4493-9052-9b4c7954cabe

📥 Commits

Reviewing files that changed from the base of the PR and between 51352d9 and 764e577.

📒 Files selected for processing (9)
  • docs/man_pages/project/testing/test-android.md
  • docs/man_pages/project/testing/test-init.md
  • docs/man_pages/project/testing/test-ios.md
  • docs/man_pages/project/testing/test-visionos.md
  • docs/man_pages/project/testing/test.md
  • lib/bootstrap.ts
  • lib/commands/test-init.ts
  • lib/commands/test.ts
  • resources/test/vitest.config.mts
🚧 Files skipped from review as they are similar to previous changes (4)
  • lib/bootstrap.ts
  • resources/test/vitest.config.mts
  • docs/man_pages/project/testing/test-init.md
  • lib/commands/test-init.ts

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread docs/man_pages/project/testing/test-visionos.md
[test init](test-init.html) | Configures your project for unit testing with a selected framework.
[test android](test-android.html) | Runs the tests in your project on Android devices or native emulators.
[test ios](test-ios.html) | Runs the tests in your project on iOS devices or the iOS Simulator.
<% } %>

@coderabbitai coderabbitai Bot Aug 8, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

End the Markdown table before the template directive.

Line 46 is parsed as a one-column table row. markdownlint-cli2 reports MD056. Insert a blank line before <% } %>.

Proposed fix
 [test ios](test-ios.html) | Runs the tests in your project on iOS devices or the iOS Simulator.
+
 <% } %>
🧰 Tools
🪛 markdownlint-cli2 (0.23.2)

[warning] 46-46: Table column count
Expected: 2; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/man_pages/project/testing/test-visionos.md` at line 46, Insert a blank
line immediately before the `<% } %>` template directive in the Markdown table
section so the table is terminated before the directive and markdownlint MD056
no longer treats it as a table row.

Source: Linters/SAST tools

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@NathanWalker
NathanWalker merged commit 9737223 into main Aug 11, 2026
12 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@NathanWalker
NathanWalker deleted the feat/vitest-unit-tests branch August 11, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@coderabbitai coderabbitai[bot] coderabbitai[bot] left review comments
@triniwiz triniwiz triniwiz approved these changes
@edusperoni edusperoni Awaiting requested review from edusperoni

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@NathanWalker @triniwiz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.