unit-tests
Skill12 starsChanged 6 months agoMITView on GitHub
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.
17 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- LeanMeanCleanApps/CleanModelContextProtocoltheir own version, first seen Nov 8, 2026
- microsoft/vscodeedited, first seen Nov 2, 2026
- shangyiy/life-kittheir own version, first seen Nov 1, 2026
- GoogleCloudPlatform/cloud-solutionstheir own version, first seen Nov 1, 2026
- 1Shot-API/skillstheir own version, first seen Oct 13, 2026
- bftelman/skillstheir own version, first seen Oct 13, 2026
Other versions17 projects use a version of this.
Word for word · 5
- posit-dev/positron★ 4.3k100% same
- NeuralInverse/neuralinverse★ 221100% same
- OpenCortexIDE/cortexide★ 175100% same
- cpkt9762/opencode-vscode-ide★ 17100% same
- 0-draft/zeus★ 1100% same
Edited · 1
- microsoft/vscode★ 195k53% same
Wrote their own version · 11
- bklit/bklit-ui★ 1.9ksame name
- genlayerlabs/genlayer-studio★ 180same name
- GoogleCloudPlatform/cloud-solutions★ 139same name
- shangyiy/life-kit★ 10same name
- WordPress/core-contributor-skills★ 10same name
- bftelman/skills★ 2same name
- 1Shot-API/skills★ 1same name
- LeanMeanCleanApps/CleanModelContextProtocol★ 1same name
- karimtrapper/claude-skills★ 0same name
- scottmillner/agentic-engineering★ 0same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository24 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- launchSkill
- accessibilitySkill
- add-policySkill
- author-contributionsSkill
- auto-perf-optimizeSkill
- azure-pipelinesSkill
- chat-customizations-editorSkill
- chat-perfSkill
- component-fixturesSkill
- cpu-profile-analysisSkill
- fix-ci-failuresSkill
- fix-errorsSkill
- heap-snapshot-analysisSkill
- hygieneSkill
- integration-testsSkill
- memory-leak-auditSkill
- omnicode-logsSkill
- otelSkill
- sessionsSkill
- tool-rename-deprecationSkill
- update-screenshotsSkill
- vscode-dev-workbenchSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
If the runTests tool is available, prefer it over running shell commands.
- Very specific: line 20
When the runTests tool is not available (e.g.
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
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.
Example (conceptual): run tests in src/vs/editor/test/common/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.
./scripts/test.sh src/vs/editor/test/common/model.test.ts.\scripts\test.bat src\vs\editor\test\common\model.test.tsMultiple files:
./scripts/test.sh src/vs/editor/test/common/model.test.ts src/vs/editor/test/common/range.test.ts--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.
./scripts/test.sh --run src/vs/editor/test/common/model.test.tsMultiple files can be specified by repeating --run:
./scripts/test.sh --run src/vs/editor/test/common/model.test.ts --run src/vs/editor/test/common/range.test.ts--grep <pattern> (aliases: -g, -f) - Filter tests by name
Runs only tests whose full title matches the pattern (passed to Mocha's --grep).
./scripts/test.sh --grep "should split lines"Combine with --run to filter tests within a specific file:
./scripts/test.sh --run src/vs/editor/test/common/model.test.ts --grep "should split lines"--runGlob <pattern> (aliases: --glob, --runGrep) - Run tests matching a glob
Runs all test files matching a glob pattern against the compiled output directory. Useful for running all tests under a feature area.
./scripts/test.sh --runGlob "**/editor/test/**/*.test.js"Note: the glob runs against compiled .js files in the output directory, not source .ts files.
--coverage - Generate a coverage report
./scripts/test.sh --run src/vs/editor/test/common/model.test.ts --coverage--timeout <ms> - Set test timeout
Override the default Mocha timeout for long-running tests.
./scripts/test.sh --run src/vs/editor/test/common/model.test.ts --timeout 10000Integration tests
Integration tests (files ending in .integrationTest.ts or located in extensions/) are not run by scripts/test.sh. Use scripts/test-integration.sh (or scripts/test-integration.bat) instead. See the integration-tests skill for details.
Compilation requirement
Tests run against compiled JavaScript output. Ensure the VS Code - Build watch task is running or that compilation has completed before running tests. Test failures caused by stale output are a common pitfall.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

