@nrwl/vite:test
Test using Vitest.
Options can be configured in project.json when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/reference/project-configuration#targets.
title: Examples for the Vitest executor description: This page contains examples for the Vitest @nrwl/vite:test executor.
project.json:
//...
"my-app": {
    "targets": {
        //...
        "test": {
            "executor": "@nrwl/vite:test",
            //...
            //...
            "options": {
                "config": "apps/my-app/vite.config.ts"
            }
            //...
        }
    }
}
nx test my-app
Examples
To run testing in watch mode, you can create a new configuration within your test target, and have watch set to true. For example:
"my-app": {
    "targets": {
        //...
        "test": {
            "executor": "@nrwl/vite:test",
            //...
            //...
            "options": {
                "config": "apps/my-app/vite.config.ts"
            },
            "configurations": {
                "watch": {
                    "watch": true
                }
            }
        }
    }
}
And then run nx run my-app:test:watch.
Alternatively, you can just run the default test target with the --watch flag preset, like so:
nx run my-app:test --watch