Right-click a JavaScript/TypeScript file and run its related Jest tests, without leaving the editor or typing a command.
Features
- Explorer & editor context menu — right-click any
.js,.jsx,.ts, or.tsxfile (in the File Explorer or in an open editor tab) and select Run Related Jest Tests. - Source Control context menu — right-click a changed file in the Source Control (SCM) sidebar and select Run Related Jest Tests (SCM) to test just what you've touched.
Usage
- Open a JS/TS/JSX/TSX file, or select one in the File Explorer.
- Right-click and choose Run Related Jest Tests (or, for a pending change, right-click the file in the Source Control sidebar and choose Run Related Jest Tests (SCM)).
- A terminal named
Jestopens and runsjest --findRelatedTestsagainst that file.
Release Notes
See CHANGELOG.md for the full history. Highlights:
- Automatic discovery of the nearest Jest install, including monorepo/hoisted layouts and an
npxfallback. - Support for JS, JSX, TS, and TSX files.
- A Source Control context-menu command for running related tests on changed files.
Contributing / Development
npm install- Press F5 in VS Code to launch the Extension Development Host and try the commands in a new window.
npm run watchruns webpack in watch mode while you work.npm run lintandnpm testbefore submitting changes (npm testcompiles the extension and its tests, lints, then runs the Mocha suite via@vscode/test-electron).
To produce a .vsix package locally:
npm install -g @vscode/vsce
npm install
npm run compile
npm run package
npm run vscode:package