hi-ogawa / vitest-vscode

VS Code extension for Vitest

Home Page:https://marketplace.visualstudio.com/items?itemName=ZixuanChen.vitest-explorer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vitest extension for Visual Studio Code logo

Vitest extension for Visual Studio Code. Available on Visual Studio Marketplace.

Features

  • Run, debug, and watch Vitest tests in Visual Studio Code.
  • NX support (see the NX sample).
  • An @open tag can be used when filtering tests, to only show the tests open in the editor.

Requirements

  • Visual Studio Code version >= 1.77.0.
  • Vitest version >= v1.4.0

Introduction

You can identify if your config is loaded by the extension with process.env.VITEST_VSCODE and change the configuration accordingly.

Configuration

  • vitest.packagePath: The path to a custom Vitest's package.json file. It will be used to resolve Vitest API paths.
  • vitest.nodeExecutable: This extension spawns another process and will use this value as execPath argument.
  • vitest.nodeEnv: Environment passed to the runner process in addition to process.env
  • vitest.debugExclude: Excludes files matching specified glob patterns from debugging. Default: [\"<node_internals>/**\", \"**/node_modules/**\"]

FAQs (Frequently Asked Questions)

How can I use it in monorepo?

See https://vitest.dev/guide/workspace.html for monorepo support.

How can I use this extension when tests are under a sub directory?

You can use VS Code command add folder to workspace to add the sub directory. The extension should work fine.

About

VS Code extension for Vitest

https://marketplace.visualstudio.com/items?itemName=ZixuanChen.vitest-explorer

License:MIT License


Languages

Language:TypeScript 96.5%Language:JavaScript 3.5%