Run and debug Jest, Vitest, Playwright, Rstest, Bun, Deno and Node.js tests right from your editor. One click, zero configuration.
Install • Quick Start • Features • Supported Frameworks • Configuration • Documentation • FAQ
Jest Runner is a lightweight Visual Studio Code extension that lets you run a single test, a describe block or a whole test file without leaving the editor. It adds Run and Debug actions above every test (CodeLens), a native Test Explorer with code coverage, context menu entries and commands for the keyboard.
It started as a Jest test runner and grew into a universal JavaScript and TypeScript test runner for VS Code: it detects whether a file belongs to Jest, Vitest, Playwright, Rstest, Bun, Deno or the Node.js test runner and builds the right command for it. Monorepos, multiple configs, Create React App, Nx, Next.js, NestJS and Vite projects work out of the box.
💡 Why not the built-in runner of each framework? Jest Runner runs the real CLI of your project in a terminal or the debugger, with your config, your environment and your Node version. Nothing is emulated, so what passes here passes in CI.
Search for Jest Runner in the Extensions view (Ctrl+Shift+X / Cmd+Shift+X), or install from the command line:
code --install-extension firsttris.vscode-jest-runnerAlso available on Open VSX for VSCodium, Cursor, Windsurf, Gitpod and other VS Code based editors. Requires VS Code 1.100 or newer.
- Open a project that uses one of the supported test frameworks.
- Open a test file. Run and Debug appear above each
describe,itandtest. - Click Run to execute that test in the integrated terminal, or Debug to hit your breakpoints.
That is all. Jest Runner reads your jest.config.*, vitest.config.*, playwright.config.*, rstest.config.* or deno.json to find your tests, so there is nothing to configure in most projects.
Want the tree view? Enable the native Test Explorer:
"jestrunner.enableTestExplorer": true
|
|
|
|
| Framework | Run | Debug | Coverage | How it is detected |
|---|---|---|---|---|
| Jest | ✅ | ✅ | ✅ | jest.config.*, jest key in package.json, dependency or binary |
| Vitest | ✅ | ✅ | ✅ | vitest.config.* or vite.config.* with a test section, dependency or binary |
| Playwright | ✅ | ✅ | — | import ... from '@playwright/test', playwright.config.* |
| Rstest | ✅ | ✅ | ✅ | import ... from '@rstest/core', rstest.config.* |
| Bun test | ✅ | ✅ ¹ | ✅ | import ... from 'bun:test', bun.lock |
| Deno test | ✅ | ✅ | ✅ | Deno.test(...), @std/assert imports, deno.json |
| Node.js test runner | ✅ | ✅ | ✅ | import ... from 'node:test' |
¹ Debugging Bun tests needs the Bun for Visual Studio Code extension.
Jest Runner also works with the tools built on top of these frameworks: Create React App, Vite, Nx, Next.js, NestJS, TanStack Start and other setups that wrap one of these runners. See Supported Test Frameworks in the documentation for what is read from each config file.
Most projects need no settings. When you do, every option lives under jestrunner.* in your VS Code settings. The most used ones:
| Setting | What it does |
|---|---|
jestrunner.enableTestExplorer |
Show tests in the native Test Explorer with run, debug and coverage profiles. Default false. |
jestrunner.enableCodeLens / jestrunner.codeLens |
Show the inline actions and choose which: run, debug, watch, coverage, current-test-coverage. |
jestrunner.jestCommand, vitestCommand, playwrightCommand, rstestCommand, nodeTestCommand |
Replace the command, e.g. npm run test -- for Create React App. Supports ${workspaceFolder} and ${env:NAME}. |
jestrunner.runOptions, vitestRunOptions, playwrightRunOptions, ... |
Extra CLI flags for each framework, e.g. ["--coverage", "--colors"]. |
jestrunner.debugOptions, vitestDebugOptions, ... |
Add or override the generated VS Code debug configuration. |
jestrunner.configPath / jestrunner.vitestConfigPath |
A config path, or a glob-to-config mapping for several configs in one workspace. |
jestrunner.projectPath |
Run tests from a sub folder instead of the workspace root. |
jestrunner.useNearestConfig |
Use the closest config file above the test file. Handy for nested projects. |
jestrunner.disableFrameworkConfig / jestrunner.defaultTestPatterns |
Skip config parsing and use your own test file globs. |
jestrunner.enableESM |
Add --experimental-vm-modules for ESM projects on Jest. |
The complete list of all settings with examples is in the Settings Reference. Ready-made setups for Create React App, nvm, ESM, monorepos and Windows shells are in the Recipes.
Jest Runner ships no default keybindings so it never collides with yours. Add what you need in Preferences: Open Keyboard Shortcuts (JSON):
{ "key": "alt+1", "command": "extension.runJest" },
{ "key": "alt+2", "command": "extension.debugJest" },
{ "key": "alt+3", "command": "extension.watchJest" },
{ "key": "alt+4", "command": "extension.runPrevJest" }All commands keep their historic Jest names, but each one runs the framework of the current file.
| Command | ID | What it runs |
|---|---|---|
| Run Jest / Debug Jest | extension.runJest, extension.debugJest |
The test at the cursor (or the selected text as test name) |
| Run Jest on File | extension.runJestFile |
The whole file |
| Run Jest on Path / Debug Jest on Path | extension.runJestPath, extension.debugJestPath |
A file or folder from the explorer context menu |
| Run Jest --watch | extension.watchJest |
The test at the cursor in watch mode |
| Run Jest and generate Coverage | extension.runJestCoverage |
The test at the cursor with --coverage |
| Run Jest and update Snapshots | extension.runJestAndUpdateSnapshots |
The test at the cursor with -u |
| Run Jest - Run Previous Test | extension.runPrevJest |
Repeats the last run or debug session |
- Config files are parsed, not executed. Jest Runner reads
testMatch,testRegex,include,exclude,roots,testDirandprojectswith a static parser that understands literals, local variables,require()of local files and wrappers such asdefineConfig. Configs built at runtime (package imports, conditions,process.env) fall back to the default patterns; setjestrunner.disableFrameworkConfigandjestrunner.defaultTestPatternsin that case. - Coverage in the editor needs the Test Explorer. Jest, Rstest, Node.js, Bun and Deno work without setup; Vitest needs
@vitest/coverage-v8or@vitest/coverage-istanbulinstalled andcoverage.providerset in its config. The report directory is read fromcoverageDirectory/reportsDirectory, otherwisecoverage/. - Debugging Bun tests requires the Bun for Visual Studio Code extension; everything else uses the built-in JavaScript debugger.
- Parameterized tests (
it.each,test.each,describe.each) get one entry per row when the table is a literal in the file, with%s,%i,%#,$nameand$obj.propfilled in. Dynamic names such asit(MyClass.prototype.method.name, ...)work too. - Logs of what was detected and which command was started go to the Jest Runner output channel. Turn on
jestrunner.enableDebugLogsbefore reporting a bug.
The full documentation lives at firsttris.github.io/vscode-jest-runner:
The same pages are browsable in the docs folder of this repository.
Does Jest Runner replace the official Jest, Vitest or Playwright extension?
It can. Jest Runner is deliberately small: it does not watch your whole project in the background or run tests on save. It runs exactly the test you ask for, through the real CLI, and shows the result in the terminal or the Test Explorer. If you only want a fast way to run and debug a single test, this is it.
How does it know whether a file is a Jest or a Vitest test?
Per file. Jest Runner first looks at the imports (bun:test, node:test, @playwright/test, @rstest/core, Deno.test), then walks up the directories looking for jest.config.*, vitest.config.* or vite.config.*, then checks package.json dependencies and installed binaries. When both Jest and Vitest configs exist, the testMatch and include patterns decide. Details are in Test Detection.
My tests do not show up or the wrong framework is used.
Enable jestrunner.enableDebugLogs and open the Jest Runner output channel: it logs which config was read and which patterns were applied. Config files are read by a static parser that does not execute code, so a config built at runtime may not be understood. In that case set jestrunner.disableFrameworkConfig: true and list your test globs in jestrunner.defaultTestPatterns. More in Troubleshooting.
Does it work on Windows, with PowerShell, cmd and Git Bash?
Yes. Test names are quoted for the shell of your integrated terminal, .cmd shims such as npx are started through cmd.exe where needed, long command lines are split and the whole process tree is killed on cancel. The end-to-end tests run on Windows, macOS and Linux in CI.
Does it support ESM projects?
Vitest, Bun, Deno and the Node.js runner are ESM-native. For Jest set jestrunner.enableESM: true, which adds --experimental-vm-modules to NODE_OPTIONS for runs and debug sessions.
Bug reports, feature requests and pull requests are welcome. Start with the open issues or read Development & Release to build, test and debug the extension locally:
git clone https://github.com/firsttris/vscode-jest-runner.git
cd vscode-jest-runner
npm ci
npm test # unit tests
npm run build # bundle to dist/extension.js, then press F5 in VS Code⭐ Like Jest Runner? A star on GitHub helps others find it.
🐛 Report a bug · 💡 Request a feature
License: MIT · © Tristan Teufel and contributors