Online / 6 & 7 February 2021


Testing Visual Studio Code extensions

Visual Studio Code is an extremely popular editor and has a very rich ecosystem of extensions. However, testing these extensions is rather tricky in practice. Often extensions require external resources which have to be injected into the development environment. Unit tests are quite bad at testing the UI itself, as they require extensive setup code and a lot of mocking (= implementation of the production API in the testing environment that exposes the same interface). Checking the results of them still requires one to manually verify that the UI looks correct. All this combined can easily lead to false-positives and false-negatives. Integration tests on the other hand are not a silver bullet either as they can be rather brittle, slow, lengthy to write, hard to set up while also not being able to cover edge-cases very efficiently. This talk will focus on what we learned while developing the Open Build Service Connector: which testing strategies work, which don't and what tools to use. We will cover some viable approaches to unit testing and the vscode-extension-tester module that we used for integration tests.


Dan Čermák