

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
123456# Writing Tests78Canonical reference: https://github.com/microsoft/vscode/wiki/Writing-Tests910## Test Types1112| Type | File suffix | Location | Runs in |13|------|-------------|----------|---------|14| Unit tests | `.test.ts` | `src/vs/**/test/` | Browser, Electron, or Node.js (depends on layer) |15| Integration tests | `.integrationTest.ts` | `src/vs/**/test/` | Real external APIs |16| Extension tests | Standard extension test system | `extensions/*/` | Extension host |1718## Running Tests1920- **Unit tests:** `scripts/test.sh` (macOS/Linux) or `scripts/test.bat` (Windows)21 - Filter: `--grep <pattern>`22 - Glob: `--runGlob **/myFile.test.js`23- **Integration tests:** `scripts/test-integration.sh` or `scripts/test-integration.bat`24- **VS Code UI:** Use the [Selfhost Test Provider](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-selfhost-test-provider)2526## Writing Unit Tests2728Tests use Mocha's BDD interface (`suite`/`test`) with the `assert` module and `sinon` for mocks.2930### Clean Teardown3132Always use `ensureNoDisposablesAreLeakedInTestSuite()` to catch disposal leaks:3334```typescript35suite('myTests', () => {36 const store = ensureNoDisposablesAreLeakedInTestSuite();3738 test('example', () => {39 const disposable = store.add(new MyDisposable());40 // ...41 });42});43```4445Always call `sinon.restore()` in `teardown` to avoid leaking mocks.4647### Best Practices4849- Minimize assertions per test — prefer one `assert.deepStrictEqual` snapshot over many fine-grained assertions50- Don't add tests to the wrong suite — find the relevant `suite` block51- Follow existing patterns (`describe`/`test` or `suite`/`test`) consistently within a file52- Don't stub globals (e.g., `(mainWindow as any).X = ...`) — make dependencies injectable instead5354### Snapshot Testing5556Use `assertSnapshot` for Jest-like snapshot tests. Snapshots are written to a `__snapshots__` directory beside the test file on first run — verify the output is correct, then subsequent runs compare against it.57
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| microsoft/vscodeextensions/copilot/src/platform/authentication/common/AGENTS.md · 189k | AGENTS.md | archsecurityagent-behaviour | 58/100 | 14 days ago | |
| microsoft/vscode.github/instructions/oss.instructions.md · 189k | Copilot instructions | git | 44/100 | 14 days ago | |
| microsoft/vscode.github/copilot-instructions.md · 189k | Copilot instructions | stylearchtypesui+2 | 74/100 | 13 days ago | |
| microsoft/vscode.github/instructions/accessibility.instructions.md · 189k | Copilot instructions | styledo-not | 61/100 | 14 days ago | |
| microsoft/vscode.github/instructions/agentHostTesting.instructions.md · 189k | Copilot instructions | teststyletesting-strategyagent-behaviour | 55/100 | 7 days ago | |
| microsoft/vscode.github/instructions/best-practices.instructions.md · 189k | Copilot instructions | styleui | 60/100 | today | |
| microsoft/vscode.github/instructions/chat.instructions.md · 189k | Copilot instructions | agent-behaviour | 39/100 | today | |
| microsoft/vscode.github/instructions/coding-guidelines.instructions.md · 189k | Copilot instructions | styletypesuidocs | 60/100 | 14 days ago | |
| microsoft/vscode.github/instructions/committing.instructions.md · 189k | Copilot instructions | do-not | 23/100 | 14 days ago | |
| microsoft/vscode.github/instructions/css-best-practices.instructions.md · 189k | Copilot instructions | styleui | 29/100 | 14 days ago | |
| microsoft/vscode.github/instructions/design-philosophy.instructions.md · 189k | Copilot instructions | style | 34/100 | 14 days ago | |
| microsoft/vscode.github/instructions/design-tokens.instructions.md · 189k | Copilot instructions | styledo-not | 65/100 | 14 days ago | |
| microsoft/vscode.github/instructions/interactive.instructions.md · 189k | Copilot instructions | ui | 43/100 | 14 days ago | |
| microsoft/vscode.github/instructions/notebook.instructions.md · 189k | Copilot instructions | no sections | 48/100 | 14 days ago | |
| microsoft/vscode.github/instructions/observables.instructions.md · 189k | Copilot instructions | no sections | 40/100 | 14 days ago | |
| microsoft/vscode.github/instructions/oss-third-party-notices.instructions.md · 189k | Copilot instructions | buildgitdependenciesdeployment+1 | 65/100 | 14 days ago | |
| microsoft/vscode.github/instructions/sessions.instructions.md · 189k | Copilot instructions | no sections | 24/100 | today | |
| microsoft/vscode.github/instructions/source-code-organization.instructions.md · 189k | Copilot instructions | do-not | 73/100 | 14 days ago | |
| microsoft/vscode.github/instructions/telemetry.instructions.md · 189k | Copilot instructions | styletypesdo-not | 65/100 | 14 days ago | |
| microsoft/vscode.github/instructions/tree-widgets.instructions.md · 189k | Copilot instructions | stylearchperformance | 62/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 65 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 14 days ago | |
| HerringtonDarkholme/megarepo.github/copilot-instructions.md · 17 | Copilot instructions | setupbuildtestlint-format+7 | 100/100 | 14 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 32k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 7 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 14 days ago | |
| darkmatter/nixmac.github/copilot-instructions.md · 25 | Copilot instructions | setupbuildtestlint-format+8 | 96/100 | 14 days ago | |
| nerolis-lab/nerolis-lab.github/copilot-instructions.md · 32 | Copilot instructions | setupbuildtestlint-format+11 | 96/100 | 14 days ago | |
| thangaram611/second-brain.github/copilot-instructions.md · 0 | Copilot instructions | setupteststylearch+4 | 96/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/microsoft-vscode-github-instructions-writing-tests-instructions)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.