[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M699BNCPJESGVM3014MSXF9W":3,"skill-same:01M699BNCPJESGVM3014MSXF9W":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":42,"commitSha":43,"skillDirectory":44,"forksCount":45,"repositoryHtmlUrl":46,"repositoryHomepageUrl":47,"ownerHtmlUrl":48,"ownerBlogUrl":49,"ownerDescription":50,"updatedAt":51,"install":52,"resources":65},"01M699BNCPJESGVM3014MSXF9W","unit-tests",null,"Use when running unit tests in the VS Code repo. Covers the runTests tool, scripts\u002Ftest.sh (macOS\u002FLinux) and scripts\u002Ftest.bat (Windows), and their supported arguments for filtering, globbing, and debugging tests.","microsoft\u002Fvscode","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M6998NK2WED5M549DX06VBCH",195271,"MIT","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Funit-tests\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],"unit tests","unit","tests","filtering","running","when","for","scripts","bat","use","macos","repo","tool","code","debugging","windows","test","linux","2026-11-10 10:12:30",false,"---\nname: unit-tests\ndescription: Use when running unit tests in the VS Code repo. Covers the runTests tool, scripts\u002Ftest.sh (macOS\u002FLinux) and scripts\u002Ftest.bat (Windows), and their supported arguments for filtering, globbing, and debugging tests.\n---\n\n# Running Unit Tests\n\n## Preferred: Use the `runTests` tool\n\nIf the `runTests` tool is available, **prefer it** over running shell commands. It provides structured output with detailed pass\u002Ffail information and supports filtering by file and test name.\n\n- Pass absolute paths to test files via the `files` parameter.\n- Pass test names via the `testNames` parameter to filter which tests run.\n- Set `mode=\"coverage\"` to collect coverage.\n\nThe 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.\n\nExample (conceptual): run tests in `src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fmodel\u002Fmodel.test.ts` with test name filter `\"should split lines\"`.\n\n## Fallback: Shell scripts\n\nWhen the `runTests` tool is not available (e.g. in CLI environments), use the platform-appropriate script from the repo root:\n\n- **macOS \u002F Linux:** `.\u002Fscripts\u002Ftest.sh [options]`\n- **Windows:** `.\\scripts\\test.bat [options]`\n\nThese scripts download Electron if needed and launch the Mocha test runner.\n\n### Commonly used options\n\n#### Bare file paths - Run tests from specific files\n\nPass source file paths directly as positional arguments. The test runner automatically treats bare `.ts`\u002F`.js` positional arguments as `--run` values.\n\n```bash\n.\u002Fscripts\u002Ftest.sh src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fmodel\u002Fmodel.test.ts\n```\n\n```bat\n.\\scripts\\test.bat src\\vs\\editor\\test\\common\\model\\model.test.ts\n```\n\nMultiple files:\n\n```bash\n.\u002Fscripts\u002Ftest.sh src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fmodel\u002Fmodel.test.ts src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fcore\u002Frange.test.ts\n```\n\n#### `--run \u003Cfile>` - Run tests from a specific file (explicit form)\n\nAccepts a **source file path** (starting with `src\u002F`). The runner strips the `src\u002F` prefix and the `.ts`\u002F`.js` extension automatically to resolve the compiled module.\n\n```bash\n.\u002Fscripts\u002Ftest.sh --run src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fmodel\u002Fmodel.test.ts\n```\n\nMultiple files can be specified by repeating `--run`:\n\n```bash\n.\u002Fscripts\u002Ftest.sh --run src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fmodel\u002Fmodel.test.ts --run src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fcore\u002Frange.test.ts\n```\n\n#### `--grep \u003Cpattern>` (aliases: `-g`, `-f`) - Filter tests by name\n\nRuns only tests whose full title matches the pattern (passed to Mocha's `--grep`).\n\n```bash\n.\u002Fscripts\u002Ftest.sh --grep \"should split lines\"\n```\n\nCombine with `--run` to filter tests within a specific file:\n\n```bash\n.\u002Fscripts\u002Ftest.sh --run src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fmodel\u002Fmodel.test.ts --grep \"should split lines\"\n```\n\n#### `--runGlob \u003Cpattern>` (aliases: `--glob`, `--runGrep`) - Run tests matching a glob\n\nRuns all test files matching a glob pattern against the compiled output directory. Useful for running all tests under a feature area.\n\n```bash\n.\u002Fscripts\u002Ftest.sh --runGlob \"**\u002Feditor\u002Ftest\u002F**\u002F*.test.js\"\n```\n\nNote: the glob runs against compiled `.js` files in the output directory, not source `.ts` files.\n\n#### `--coverage` - Generate a coverage report\n\n```bash\n.\u002Fscripts\u002Ftest.sh --run src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fmodel\u002Fmodel.test.ts --coverage\n```\n\n#### `--timeout \u003Cms>` - Set test timeout\n\nOverride the default Mocha timeout for long-running tests.\n\n```bash\n.\u002Fscripts\u002Ftest.sh --run src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fmodel\u002Fmodel.test.ts --timeout 10000\n```\n\n#### `--workers \u003Ccount>` - Run test files in parallel processes\n\nSpreads a run of **all** test files, or of the files of `--runList`, across `\u003Ccount>` worker processes. The count is required, and capped at one worker per CPU and per 2 GB of memory, because every worker loads all test files of the run. Every worker loads all test files of the run and runs the files it claims, in the usual order. With `--runList`, it starts one worker per 75 of the listed test files that the runner runs, but at least 2, because one slow test file would otherwise hold up all the others, and never more than there are files. It is ignored, and the run uses a single window or process, with `--run`, `--runGlob`, bare file paths, `--grep`, `--coverage` or `--dev`. With `--rerun-failed-files`, the failures of all workers are rerun in a single window or process. When a worker fails, the runner prints the test files it ran, in order, to pass to `--run` to reproduce the failure. `pnpm run test-node` and `pnpm run test-browser` accept it as well; the browser runner starts its own browser in every worker, runs the browsers one at a time, and ignores it with `--debug`.\n\n```bash\n.\u002Fscripts\u002Ftest.sh --workers 4\n.\u002Fscripts\u002Ftest.sh --workers 4 --runList .build\u002Faffected-tests.txt\npnpm run test-node --workers 4\npnpm run test-browser --browser chromium --workers 4\n```\n\n### Integration tests\n\nIntegration tests (files ending in `.integrationTest.ts` or located in `extensions\u002F`) are **not run** by `scripts\u002Ftest.sh`. Use `scripts\u002Ftest-integration.sh` (or `scripts\u002Ftest-integration.bat`) instead. See the `integration-tests` skill for details.\n\n### Compilation requirement\n\nTests run against compiled JavaScript output. Reuse current output from an existing `VS Code - Build` task when available; otherwise refresh client output with `pnpm run build-fast --client-only` before running tests. This supports cold and incremental builds without a persistent watcher or extension builds. Use `pnpm run build-fast` when extension and Copilot outputs are also needed. Fast builds transpile rather than type-check, so run appropriate explicit type checks when warranted by the change. Do not rebuild between test selections when inputs have not changed. Test failures caused by stale output are a common pitfall.\n","# Running Unit Tests\n\n## Preferred: Use the `runTests` tool\n\nIf the `runTests` tool is available, **prefer it** over running shell commands. It provides structured output with detailed pass\u002Ffail information and supports filtering by file and test name.\n\n- Pass absolute paths to test files via the `files` parameter.\n- Pass test names via the `testNames` parameter to filter which tests run.\n- Set `mode=\"coverage\"` to collect coverage.\n\nThe 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.\n\nExample (conceptual): run tests in `src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fmodel\u002Fmodel.test.ts` with test name filter `\"should split lines\"`.\n\n## Fallback: Shell scripts\n\nWhen the `runTests` tool is not available (e.g. in CLI environments), use the platform-appropriate script from the repo root:\n\n- **macOS \u002F Linux:** `.\u002Fscripts\u002Ftest.sh [options]`\n- **Windows:** `.\\scripts\\test.bat [options]`\n\nThese scripts download Electron if needed and launch the Mocha test runner.\n\n### Commonly used options\n\n#### Bare file paths - Run tests from specific files\n\nPass source file paths directly as positional arguments. The test runner automatically treats bare `.ts`\u002F`.js` positional arguments as `--run` values.\n\n```bash\n.\u002Fscripts\u002Ftest.sh src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fmodel\u002Fmodel.test.ts\n```\n\n```bat\n.\\scripts\\test.bat src\\vs\\editor\\test\\common\\model\\model.test.ts\n```\n\nMultiple files:\n\n```bash\n.\u002Fscripts\u002Ftest.sh src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fmodel\u002Fmodel.test.ts src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fcore\u002Frange.test.ts\n```\n\n#### `--run \u003Cfile>` - Run tests from a specific file (explicit form)\n\nAccepts a **source file path** (starting with `src\u002F`). The runner strips the `src\u002F` prefix and the `.ts`\u002F`.js` extension automatically to resolve the compiled module.\n\n```bash\n.\u002Fscripts\u002Ftest.sh --run src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fmodel\u002Fmodel.test.ts\n```\n\nMultiple files can be specified by repeating `--run`:\n\n```bash\n.\u002Fscripts\u002Ftest.sh --run src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fmodel\u002Fmodel.test.ts --run src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fcore\u002Frange.test.ts\n```\n\n#### `--grep \u003Cpattern>` (aliases: `-g`, `-f`) - Filter tests by name\n\nRuns only tests whose full title matches the pattern (passed to Mocha's `--grep`).\n\n```bash\n.\u002Fscripts\u002Ftest.sh --grep \"should split lines\"\n```\n\nCombine with `--run` to filter tests within a specific file:\n\n```bash\n.\u002Fscripts\u002Ftest.sh --run src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fmodel\u002Fmodel.test.ts --grep \"should split lines\"\n```\n\n#### `--runGlob \u003Cpattern>` (aliases: `--glob`, `--runGrep`) - Run tests matching a glob\n\nRuns all test files matching a glob pattern against the compiled output directory. Useful for running all tests under a feature area.\n\n```bash\n.\u002Fscripts\u002Ftest.sh --runGlob \"**\u002Feditor\u002Ftest\u002F**\u002F*.test.js\"\n```\n\nNote: the glob runs against compiled `.js` files in the output directory, not source `.ts` files.\n\n#### `--coverage` - Generate a coverage report\n\n```bash\n.\u002Fscripts\u002Ftest.sh --run src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fmodel\u002Fmodel.test.ts --coverage\n```\n\n#### `--timeout \u003Cms>` - Set test timeout\n\nOverride the default Mocha timeout for long-running tests.\n\n```bash\n.\u002Fscripts\u002Ftest.sh --run src\u002Fvs\u002Feditor\u002Ftest\u002Fcommon\u002Fmodel\u002Fmodel.test.ts --timeout 10000\n```\n\n#### `--workers \u003Ccount>` - Run test files in parallel processes\n\nSpreads a run of **all** test files, or of the files of `--runList`, across `\u003Ccount>` worker processes. The count is required, and capped at one worker per CPU and per 2 GB of memory, because every worker loads all test files of the run. Every worker loads all test files of the run and runs the files it claims, in the usual order. With `--runList`, it starts one worker per 75 of the listed test files that the runner runs, but at least 2, because one slow test file would otherwise hold up all the others, and never more than there are files. It is ignored, and the run uses a single window or process, with `--run`, `--runGlob`, bare file paths, `--grep`, `--coverage` or `--dev`. With `--rerun-failed-files`, the failures of all workers are rerun in a single window or process. When a worker fails, the runner prints the test files it ran, in order, to pass to `--run` to reproduce the failure. `pnpm run test-node` and `pnpm run test-browser` accept it as well; the browser runner starts its own browser in every worker, runs the browsers one at a time, and ignores it with `--debug`.\n\n```bash\n.\u002Fscripts\u002Ftest.sh --workers 4\n.\u002Fscripts\u002Ftest.sh --workers 4 --runList .build\u002Faffected-tests.txt\npnpm run test-node --workers 4\npnpm run test-browser --browser chromium --workers 4\n```\n\n### Integration tests\n\nIntegration tests (files ending in `.integrationTest.ts` or located in `extensions\u002F`) are **not run** by `scripts\u002Ftest.sh`. Use `scripts\u002Ftest-integration.sh` (or `scripts\u002Ftest-integration.bat`) instead. See the `integration-tests` skill for details.\n\n### Compilation requirement\n\nTests run against compiled JavaScript output. Reuse current output from an existing `VS Code - Build` task when available; otherwise refresh client output with `pnpm run build-fast --client-only` before running tests. This supports cold and incremental builds without a persistent watcher or extension builds. Use `pnpm run build-fast` when extension and Copilot outputs are also needed. Fast builds transpile rather than type-check, so run appropriate explicit type checks when warranted by the change. Do not rebuild between test selections when inputs have not changed. Test failures caused by stale output are a common pitfall.\n",{"name":5,"description":7},"main","d2b1bf2230b505648e972e81d854743de79b65af",".github\u002Fskills\u002Funit-tests",43773,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode","https:\u002F\u002Fcode.visualstudio.com","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-11 08:47:49",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add microsoft\u002Fvscode --skill unit-tests",{"tool":58,"command":59},"bunx","bunx skills add microsoft\u002Fvscode --skill unit-tests",{"tool":61,"command":62},"pnpm","pnpm dlx skills add microsoft\u002Fvscode --skill unit-tests","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Funit-tests\u002FSKILL.md",true,[],[67,92,113,127,142,158],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":37},"01M70H0ANBKZAVEP1NVV4K28M3","sweeper-query","Answer natural-language questions about the VS Code Sweeper's published issue index (index-\u003Cname>.json for microsoft\u002Fvscode and the enrolled family repos) — which issues are agent-ready to implement or plan, what the sweeper proposed for an assignee or area, whether the sweeper knows a report as a duplicate, the highest-value open bugs in a lane — and, for one issue, the review's full record (evidence with file citations, fix brief, proposed comment). Use ONLY when the request explicitly names the sweeper — \"sweeper\", \"vscodesweeper\", \"sweeper-query\", a sweeper verdict, record, brief or index, an agent-ready issue — or asks what \"the sweeper\" found, proposed or knows. Do NOT use for general questions about issues, duplicates, priorities or ranking that do not mention the sweeper. Read-only; discovery only.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fsweeper-query\u002FSKILL.md",[],[74,75,76,77,78,24,79,80,81,82,83,84,85,86,87,88,89,90,91,32],"sweeper query","query","sweeper","review","fix","request","which","natural-language","ranking","duplicates","ready","only","read","plan","open","Citations","brief","issues",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":37},"01M699DRJS4YJCV600Q72SVVWE","update-skills","Create or update repository skills and instructions when major learnings are discovered during a session. Use when the user says \"learn!\", when a significant pattern or pitfall is identified, or when reusable domain knowledge should be captured for future sessions.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fupdate-skills\u002FSKILL.md",[],[99,100,25,101,102,103,104,28,105,106,107,108,109,110,111,112,24],"update","update skills","pattern","domain","learnings","reusable","session","user","instructions","knowledge","repository","learn","create","sessions",{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":37},"01M699DPWHZ72B66P82EW31RNE","update-pr","Update the pull request for the current session. Use when the user wants to push new changes to an existing PR.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fupdate-pr\u002FSKILL.md",[],[99,120,121,24,79,122,25,28,105,106,123,124,125,126],"pr","update pr","Existing","push","pull","pull request","changes",{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":37},"01M699DJMR6CE1MH5XCJZ0GFQ0","sync","Sync the current session branch with its upstream branch, or publish the current session branch to a remote. Use when the user asks to sync a branch, pull latest changes, rebase onto upstream, push current branch, publish branch, or set upstream.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fsync\u002FSKILL.md",[],[129,134,135,123,124,136,24,126,137,138,139,140,28,105,106,141],"SET","publish","rebase","latest","with","remote","upstream","branch",{"skillNo":143,"name":144,"nameZh":6,"description":145,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":146,"categories":147,"keywords":148,"publishedAt":37},"01M699DGXHX6A2A72X57R6GGHJ","sync-upstream","Update a stale session branch by rebasing onto the latest origin. Use when the upstream has moved significantly and the session needs to catch up, resolving conflicts by preserving upstream changes and adapting session work to fit.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fsync-upstream\u002FSKILL.md",[],[140,129,149,150,24,151,152,126,137,153,154,155,156,28,105,141,157,99],"sync upstream","fit","catch","catch up","origin","conflicts","stale","up","work",{"skillNo":159,"name":160,"nameZh":6,"description":161,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":162,"categories":163,"keywords":164,"publishedAt":37},"01M699DEXYFWDGW0BAXJ5QQ377","merge","Merge changes from the topic branch to the merge base branch. Use when the user wants to merge their session's work back to the base branch.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fmerge\u002FSKILL.md",[],[160,105,28,157,141,106,24,165,166,126],"back","base"]