Quickie: testing vscode extensions

I made a vscode language server a while back but didn’t have a great way of doing CI tests on it (to prove the artifact itself works). I recently figured out one way to do this that’s pretty convenient. I used code-server with selenium webdriver.

Code-server is pretty amazing. It just works, and you can spin up the container easily. Once you’ve confirmed that the http port is responding, you can write selenium webdriver tests against it, rendered as a fairly empty canvas here:

https://gist.github.com/prozacchiwawa/a45fe32d29d6dd66ff40baf53c39547e

Since the system will start unconfigured each time, you’ll need to click the trust button to say that you trust the workspace, right click the extension (assuming it’s in the project directory) and then click install. This will do that part, leaving the system in the state where your extension is launching.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store