Giter Site home page Giter Site logo

sarvex / vitest-vscode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vitest-dev/vscode

0.0 1.0 0.0 880 KB

VS Code extension for Vitest

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

License: MIT License

TypeScript 100.00%

vitest-vscode's Introduction


Vitest for VSCode Logo

Vitest for VSCode


This extension is powered by vscode testing api.

Features

  • Run/debug vitest tests in vscode
  • Watch mode is supported ๐ŸŽŠ. Test reruns are blazing fast

Watch Mode

Requirements

  • Require VSCode's version >= July 2021 (version 1.59).
  • Require Vitest's version >= v0.12.0

Config

  • vitest.enable: This plugin will try to detect whether the current project is set up with Vitest to activate itself. When it failed, you can enable the plugin manually
  • vitest.nodeEnv: The env passed to runner process in addition to process.env
  • vitest.commandLine: The command line to start vitest tests. It should have with the ability to append extra arguments. For example npx vitest or yarn test --.(This is a workspace setting. Do not change it in the user setting directly, which will affect all the projects you open)
  • vitest.include: Include glob for test files. Default: [\"**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}\"]
  • vitest.exclude: Exclude globs for test files. Default: [\"**/node_modules/**\", \"**/dist/**\", \"**/cypress/**\", \"**/.{idea,git,cache,output,temp}/**\"]
  • vitest.debugExclude: Automatically skip files covered by these glob patterns. Default: [\"<node_internals>/**\", \"**/node_modules/**\"]

Screenshots

Filter tests by status

Debug

Inspect console output

FAQ

How can I use it in monorepo?

It's not well supported yet. But you can use VS Code workspace as a workaround for now. Each folder of the workspace can have its own vitest extension config.

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.

test.each is not working

Dynamic test name is not supported yet. This extension currently relies on the babel parser to calculate the positions of tests statically.

Related issue: vitest-dev#133

vitest-vscode's People

Contributors

adrienbaron avatar almaraubel avatar c00 avatar evanandrewrose avatar falynx avatar geersch avatar georgemickleburgh avatar igx89 avatar infinitexyy avatar kitwon avatar lbm98 avatar ngirardin avatar robertrosman avatar tocseoj avatar xon52 avatar ypetremann avatar zxch3n avatar

Watchers

 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.