microsoft avatar

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-code

Installs 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 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:

Sponsors

Details

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

More from microsoft/vscode

All 15
1martinholovsky avatarappsec-expertmartinholovsky/claude-skills-generatorElite Application Security engineer specializing in secure SDLC, OWASP Top 10 2025, SAST/DAST/SCA integration, threat modeling (STRIDE), and vulnerability remed240skills.sh installs
2martinholovsky avatarbrowser-automationmartinholovsky/claude-skills-generatorExpert in browser automation using Chrome DevTools Protocol (CDP) and WebDriver. Specializes in secure web automation, testing, and scraping with proper credent232skills.sh installs
3guia-matthieu avatarbrand-strategyguia-matthieu/clawfu-skillsCreate distinctive brands that customers choose because they believe there's no substitute, using Marty Neumeier's Brand Gap and Zag frameworks Use when: **Buil228skills.sh installs
4leeguooooo avatarzentaoleeguooooo/zentao-mcpDEPRECATED — prefer the official zentao-cli (https://github.com/easysoft/zentao-cli) and its skills (https://github.com/easysoft/zentao-skills) for new setups. 217skills.sh installs
5pluginagentmarketplace avatarsolidity-developmentpluginagentmarketplace/custom-plugin-blockchainMaster Solidity smart contract development with patterns, testing, and best practices208skills.sh installs
6levnikolaevich avatarln-513-regression-checkerlevnikolaevich/claude-code-skillsRuns existing test suite to catch regressions after implementation changes. Use when Story needs regression verification. No status changes.206skills.sh installs