Due to the nature of VS Code, testing extensions can be quite complex. In this blog post, we explore various ways to write unit tests for VS Code extensions, as well as strategies for writing more sufficient integration tests.
Mocking cloud service dependencies in modern applications is essential for independent unit testing. We show how to mock all relevant parts of the Azure DevOps Extension SDK, Azure DevOps Extension API as well as other external APIs to create meaningful unit tests for Azure DevOps UI Extensions and reach full code coverage.