Vitest extension for Visual Studio Code. Available on Visual Studio Marketplace.
- Run, debug, and watch Vitest tests in Visual Studio Code.
- NX support (see the NX sample).
- A
@open
tag can be used when filtering tests, to only show the tests open in the editor.
- Visual Studio Code version >= July 2021 (version 1.59).
- Vitest version >= v0.12.0
vitest.enable
: Extension will automatically detect if the current project is using Vitest. If detection fails, extension can be manually enabled via this option.vitest.watchOnStartup
: Whether to activate Watch mode by default when the extension starts.vitest.nodeEnv
: Environment passed to the runner process in addition toprocess.env
vitest.commandLine
: Command to execute Vitest tests. It should have the ability to append extra arguments. For examplenpx vitest
oryarn test --
. This is a workspace setting. Do not change it in the user settings, since it will affect all the projects you open)vitest.debugExclude
: Excludes files matching specified glob patterns from debugging. Default:[\"<node_internals>/**\", \"**/node_modules/**\"]
See https://vitest.dev/guide/workspace.html for monorepo support.
You can use VS Code command add folder to workspace
to add the sub directory. The extension should work fine.