Quickie: testing vscode extensions

art yerkes
1 min readNov 12, 2022

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.

--

--