Dan Čermák
- need to connect to OBS
- have to store passwords
- unit tests are brittle
- use upstream’s development environment
- use a dirty
LD_PRELOAD
trick - test the workflows of the extension
Why is it hard?
- UIs cary a lot of state
- testing workflows is uncommon
- what you get is not what you see
- test one functionality of one unit/function
- anything touching the UI needs extensive setup & teardown
- external services need to be mocked
- documentation has an example setup
- code coverage setup more involved
- can be read & modified in tests
quickPick.onDidChangeValue(async (val: string) => {
if (verifyInput(val)) {
await launchBackgroundTask();
}
});
→ use fake events when possible
- “destructors” in VSCode
- use
after()
orafterEach()
- only check the interesting parts
- preferably keep UI part as small as possible
const editor = new TextEditor();
const pkgJsonEditor = await new EditorView().openEditor('package.json');
await pkgJsonEditor.setText('{"foo": [1, 2, 3], "bar": "baz"}');
await pkgJsonEditor.formatDocument();
- check your main workflow(s)
- don’t test corner cases & minor regressions
- upstream using mocha
- use root hooks for setup
- run steps as individual
it()
- integration tests tend to be very slow and resource demanding
- avoid explicit sleeps
- certain elements invisible by default
- no test coverage
- Visual Studio Codo Logo © Microsoft
- openSUSE Logo CC-BY-SA 3.0
- Selenium Logo CC-BY-SA 4.0
- reveal.js MIT
- Font Awesome CC-BY-4.0 and SIL OFL 1.1 and MIT
- EOS Icons MIT
- everything else is my work under CC-BY-4.0
Thank you for your time!