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
You can start running Vitest tests using its Node API:
10
10
11
-
```js twoslash
11
+
```js
12
12
import { startVitest } from'vitest/node'
13
13
14
14
constvitest=awaitstartVitest('test')
@@ -38,7 +38,7 @@ Alternatively, you can pass in the complete Vite config as the fourth argument,
38
38
39
39
You can create Vitest instance yourself using `createVitest` function. It returns the same `Vitest` instance as `startVitest`, but it doesn't start tests and doesn't validate installed packages.
You can use this method to parse CLI arguments. It accepts a string (where arguments are split by a single space) or a strings array of CLI arguments in the same format that Vitest CLI uses. It returns a filter and `options` that you can later pass down to `createVitest` or `startVitest` methods.
Copy file name to clipboardExpand all lines: docs/advanced/runner.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -110,7 +110,7 @@ Snapshot support and some other features depend on the runner. If you don't want
110
110
111
111
You can extend Vitest task system with your tasks. A task is an object that is part of a suite. It is automatically added to the current suite with a `suite.task` method:
0 commit comments