
Unit Tests
When you're working in the VS Code repository and need to run unit tests, this skill walks you through the runTests tool first, then falls back to the shell scripts (test.sh or test.bat) when necessary. It covers the practical stuff: passing file paths, filtering tests with grep, running globs, and collecting coverage. The guidance on bare file paths versus the explicit --run flag is helpful since the scripts accept both. One thing to note: these scripts only handle unit tests, not integration tests, and you need to have your build running or you'll be testing stale compiled output. It's a solid reference for the common flags and patterns without having to dig through script source code.
- skills.sh installs
- 241
- GitHub stars
- 195.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add microsoft/vscode --skill unit-tests --agent claude-codeInstalls into .claude/skills of the current project.
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
filesparameter. - Pass test names via the
testNamesparameter 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:
Sponsors
Details
- Repository
- github.com/microsoft/vscode
- Categories
- Testing & QA, Debugging
- First seen
- Jun 3, 2026