Member-only story

How to test Visual Studio Code extension — part 1

Tom Smykowski
8 min readJul 9, 2020

--

Table of contents

From this article you will learn how to:

  • how to write a complete Visual Studio Code extension test
  • find documentation, articles, and use cases to test VSCode extension
  • change extension preferences for each test case
  • programatically create and open files
  • grab information about rich features of VSCode (like CodeLens)
  • how to handle Thenable errors

Why I need VSCode extension tests?

Visual Studio Code some pretty decent API to write extensions. That is why i was able to write Assistant. A realtime linter to write easily your own code rules for annoying typos and mistakes.

The extension is now used by 52 developers around the world. Mostly thanks to the previous article I wrote with my ready-made Angular set of eight rules. I find this article a nice way to explain how Assistant can be used, because it has real life examples of code that Assistant can help with.

Also, a lots of people got the idea straight away, and gave suggestions what features they would like to have. Before i have started implementing these, a question arises. How to take care of Assistant…

--

--

Tom Smykowski
Tom Smykowski

Written by Tom Smykowski

Software Engineer & Tech Editor. Top 2% on StackOverflow, 3mil views on Quora. Won Shattered Pixel Dungeon.

Responses (1)