Git Product home page Git Product logo

vscode's Introduction

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

Configuration

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

  • vitest.rootConfig: The path to your root config file. If you have several Vitest configs, consider using a Vitest workspace.
  • vitest.workspaceConfig: The path to the Vitest workspace config file. You can only have a single workspace config per VSCode workspace.
  • vitest.configSearchPatternExclude: Glob pattern that should be ignored when this extension looks for config files. Note that this is applied to config files, not test files inside configs. Default: **/{node_modules,.*}/**
  • vitest.packagePath: The path to a package.json file of a Vitest executable (it's usually inside node_modules) in case the extension cannot find it. It will be used to resolve Vitest API paths. This should be used as a last resort fix. If the extension cannot find Vitest, please open an issue.
  • 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.

Why is the extension not activated?

The extension looks for Vitest config or Vitest workspace config to establish the connection with Vitest. If you have several config files, it's recommended to combine them in a single Vitest workspace for a better CPU performance (only have a single Vitest instance instead of several).

vscode's People

Contributors

zxch3n avatar sheremet-va avatar ffmathy avatar hi-ogawa avatar evanandrewrose avatar keroxp avatar falynx avatar igx89 avatar ngirardin avatar huwshimi avatar milankovacic avatar saitonakamura avatar kitwon avatar c00 avatar timoweave avatar mash-graz avatar infinitexyy avatar ypetremann avatar tri-star avatar robertrosman avatar seboran avatar lbm98 avatar xon52 avatar joaovictor6 avatar tocseoj avatar georgemickleburgh avatar rentalhost avatar geersch avatar cameronbrill avatar almaraubel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.