Testing extensions for Visual Studio Code
summary
Testing VS Code extensions proves brittle because UI state and external services matter and unit tests only cover tiny logic bits while workflows break. The Open Build Service Connector uses unit tests with vscode-tests for pure logic, vscode-extension-tester (Selenium/Electron) plus Mocha for integration workflows, and LD_PRELOAD to inject a fake libsecret and fake git for CI. Integration tests run slow, flake under CI, and cannot produce coverage so prioritize the top 20% workflows that cover 80% impact.
AI-written summary · about
chapters (12)
- 0:00Intro
- 3:17Testing Extensions Why is it hard?
- 6:42External Services
- 8:17Unit testing
- 9:30Getting started
- 11:05Extension Settings
- 13:27Disposables
- 15:29Manual testing
- 18:33What to test? . check your main workflows
- 19:15How to test? • upstream using mocha
- 20:26Catches
- 22:01Questions?
related talks
27mTesting Complex VSCode Extensions With the Power of Web Standards
58mWriting VS Code extensions for fun and profit
16mExtending VS Code, or How to Create Yourself a Back Office in 10 Minutes
28mStart Your Node.js Contribution by Writing Unit Tests Quickly with Vscode
19mBuilding a VS Code Extension
45mDevelopment of VSCode extensions
01h 08mWhat's New & Next in Testing & Code Coverage in Visual Studio
20mComponent Testing with Playwright
