Agent skill · software engineering · microsoft

unit-tests

Use when running unit tests in the VS Code repo. Covers the runTests tool, scripts/test.sh (macOS/Linux) and scripts/test.bat (Windows), and their supported arguments for filtering, globbing, and debugging tests.

Why this skill is useful

Adds specific commands and scripts for running unit tests in the VS Code repo that the AI wouldn't reliably generate on its own.

What it needs

Requires node installed locally. About 3k tokens when loaded. Last updated 2026-08-07. 188,455 stars on the source repository.

What this skill does

Running Unit Tests Preferred: Use the runTests tool If the runTests tool is available, prefer it over running shell commands. It provides structured output with detailed pass/fail information and supports filtering by file and test name. Pass absolute paths to test files via the files parameter. Pass test names via the testNames parameter to filter which tests run. Set mode="coverage" to collect coverage. The tool runs tests discovered by VS Code's registered test controllers; it does not compile the repository or invoke a shell test command. If discovery is unavailable, pending, or reports no executed tests, treat the request as unvalidated and use the repository's configured test command. Review per-file and test-name diagnostics for partially matched requests instead of repeatedly checking the same paths. Example (conceptual): run tests in src/vs/editor/test/common/model/model.test.ts with test name filter "should split lines". Fallback: Shell scripts When the runTests tool is not available (e.g. in CLI environments), use the platform-appropriate script from the repo root: macOS / Linux: ./scripts/test.sh [options] Windows: .\scripts\test.bat [options] These scripts download Electron if needed and launch the Mocha test runner. Commonly used options Bare file paths - Run tests from specific files Pass source file paths directly as positional arguments. The test runner automatically treats bare .ts/.js positional arguments as --run values. Multiple files: --run <file> - Run tests from a specific file (explicit form) Accepts a source file path (starting with src/). The runner strips the src/ prefix and the .ts/.js extension automatically to resolve the compiled module. Multiple files can be specified by repeating --run: --grep <pattern> (aliases: -g, -f) - Filter tests by name Runs only tests whose full title matches the pattern (passed to Mocha's --grep). …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills microsoft/unit-tests

View the source on GitHub

Browse the @skills marketplace