microsoft/vscode-cmake-tools/backend-tests
Claude Code and agent skill by microsoft/vscode-cmake-tools
- vendor
Checking that the SKILL.md file is still in the repository.
Use when writing unit tests under test/unit-tests/backend/*.test.ts that run in Node with Mocha+Chai and no VS Code API. For pure logic: parsers, helpers, env merging. Triggers: "backend test", "unit test", "mocha test without vscode".
Install
npx vskill@latest install microsoft/vscode-cmake-tools/backend-testsSKILL.md
The same SKILL.md was published earlier as microsoft/vscode-cmake-tools/backend-tests.
Writing Backend Tests
Recipe for adding backend (unit) tests that run without VS Code.
When to use backend tests
Use backend tests for pure logic that has no VS Code UI interaction. They are the fastest feedback loop — no Extension Host, no display server, just Node + Mocha.
Good candidates: string manipulation, path logic, parsers, encoding, variable expansion, data-structure helpers, environment merging.
Not suitable for: anything that calls vscode.window.*, vscode.workspace.* beyond getConfiguration(), or depends on an active editor.
File location
Import strategy — decision tree
Module has NO transitive vscode dependency
Import directly via the @cmt/* path alias.
Module transitively imports vscode
Mirror the pure function logic inline in the test file. Do not import the source module — it will fail because vscode cannot be resolved at test time (even with the mock, deep transitive chains can break).
Add a comment like // --- Mirror of <module>.<function> --- so reviewers can trace back to the source.
What setup-vscode-mock.ts provides
The mock is auto-loaded via Mocha's -r flag. It intercepts require('vscode') and returns stubs for:
workspace.getConfiguration()— returns a Proxy that yieldsundefinedworkspace.onDidChangeConfiguration/onDidCreateFiles/onDidDeleteFiles— no-opswindow.createOutputChannel/showErrorMessage/showWarningMessage— no-opscommands.registerCommand/executeCommand— no-opsPosition,Range,Uri— minimal implementationsEventEmitter,Disposable,TreeItem,ThemeIcon— stubs
This lets some modules with shallow vscode dependencies work. If your module only touches vscode.workspace.getConfiguration(), direct import may still work. Test it — if it fails, fall back to the mirror pattern.
Test framework
| Aspect | Value | |
|---|---|---|
| Runner | Mocha | |
| Style | TDD — use suite() / test(), not describe() / it() | |
| Assertions | Chai expect — import { expect } from 'chai' | |
| Path aliases | @cmt/* → src/*, @test/* → test/* |
Skeleton — direct import pattern
Skeleton — mirror pattern
Run command
Full command (for reference):
Common pitfalls
| Pitfall | Fix | |
|---|---|---|
Cannot find module 'vscode' | Module has a transitive vscode dependency — use the mirror pattern | |
suite is not defined | Mocha TDD interface not loaded — ensure you run via yarn backendTests, not mocha directly | |
Import path uses relative ../../../src/ | Use @cmt/* alias instead — tsconfig-paths/register resolves it | |
describe/it used instead of suite/test | This project uses Mocha TDD style — switch to suite/test | |
Mock returns undefined for a config value | setup-vscode-mock.ts's getConfiguration() returns undefined for everything — if your code needs a real value, you may need to extend the mock or restructure |
See also: [`.github/copilot-instructions.md`](../copilot-instructions.md) for project-wide conventions.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 8 Jun 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/backend-tests/SKILL.md
Popularity
- Repository stars
- 1,677
- Repository forks
- 527
- 7-day trend score
- 37
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/vscode-cmake-tools/backend-tests)