Skip to content
microsoft avatar

Unit Tests

Unit-test runner guide covering the runTests tool and the platform scripts with filtering, globbing, and parallel options.

CCM score
76 of 100
skills.sh installs
257
GitHub stars
195.8K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers running unit tests via the runTests tool first, then scripts/test.sh and scripts/test.bat as fallbacks
  • Includes filters --run, --grep, and --runGlob, plus --coverage, --timeout, --workers, and --isolate for debugging and isolation
  • Enforces compiled output as a prerequisite, reusing current output or running pnpm run build-fast --client-only before tests
  • Designed for contributors running VS Code repo unit tests from the CLI or an agent without the runTests tool

Install

$ npx -y skills add microsoft/vscode --skill unit-tests -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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:

Details

Repository
github.com/microsoft/vscode
Category
Testing & QA
First seen
Jun 3, 2026

Questions

What does the unit-tests skill do for a VS Code developer?

The unit-tests skill tells the agent how to run unit tests in the VS Code repository. It covers the runTests tool, which is preferred when available, and the fallback scripts scripts/test.sh on macOS and Linux and scripts/test.bat on Windows.

How do I run only some unit tests with the unit-tests skill?

Pass test file paths as bare positional arguments, or use --run for a specific file. Add --grep with a pattern to filter tests by name, or --runGlob to run all compiled test files matching a glob.

How do I install the unit-tests skill?

Run npx -y skills add microsoft/vscode --skill unit-tests -y in your project. The skill then lets the agent run VS Code unit tests with the right options for filtering, coverage, timeouts and parallel workers.

Where does the unit-tests skill stand in the Testing & QA category?

The unit-tests skill sits in the Testing & QA category on Claude Marketplaces, alongside tdd, test-driven-development, webapp-testing and break-ui. It is specific to running the unit tests of the VS Code repository, not general test writing.

More from microsoft/vscode

All 11

Similar to Unit Tests

More Testing & QA