with one click
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.
// 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.
Launch Code OSS (VS Code from sources) into an isolated throwaway profile with unique debug ports so you can drive it with @playwright/cli AND attach a Node debugger via dap-cli in the same session. Use when working on VS Code itself and you want to interact with the running workbench, automate chat or UI flows, test UI features, take screenshots, set breakpoints in the renderer / extension host / main process, or combine UI driving with debugging.
Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting session data.
Find and read logs from Code OSS dev builds. Use when: finding logs, reading log files, debugging Code OSS, checking renderer logs, extension host logs, agent host logs, main process logs, investigating errors in dev builds.
Agents window architecture — covers the agents-first app, layering, folder structure, chat widget, menus, contributions, entry points, and development guidelines. Use when implementing features or fixing issues in the Agents window.
Use when working on the Chat Customizations editor — the management UI for agents, skills, instructions, hooks, prompts, MCP servers, and plugins.
Investigate unexpected chat agent behavior by analyzing direct debug logs in JSONL files. Use when users ask why something happened, why a request was slow, why tools or subagents were used or skipped, or why instructions/skills/agents did not load.
| name | unit-tests |
| description | 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. |
runTests toolIf 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.
files parameter.testNames parameter to filter which tests run.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".
When the runTests tool is not available (e.g. in CLI environments), use the platform-appropriate script from the repo root:
./scripts/test.sh [options].\scripts\test.bat [options]These scripts download Electron if needed and launch the Mocha test runner.
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.ts
Multiple 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.ts
Multiple 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 nameRuns 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 globRuns 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 timeoutOverride the default Mocha timeout for long-running tests.
./scripts/test.sh --run src/vs/editor/test/common/model.test.ts --timeout 10000
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.
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.