@nx/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.
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.
project.json
:
//...
"my-app": {
"targets": {
//...
"test": {
"executor": "@nx/vite:test",
//...
//...
"options": {
"config": "apps/my-app/vite.config.ts"
}
//...
}
}
}
nx test my-app
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": "@nx/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
false
Enable coverage report
test
test
, benchmark
, typecheck
The mode that vitest will run on
false
Update snapshots
The path to the local vitest config
true
Pass the test even if no tests are found
An array of reporters to pass to vitest
Directory to write coverage report to.
Run tests with full names matching the pattern
The name of the file to test.
false
Enable watch mode