Why: client/src/webview/views/** is where most recent UI changes land. These functions take diagnostics or context data and return HTML, with no vscode import, so they can be tested in milliseconds without starting VS Code.
What:
- Add Vitest (
src/**/*.spec.ts, excluded from the extension build).
- Build HTML from sample data, parse it (jsdom), and check the elements rather than comparing whole HTML strings.
- First cases: the diagnostics heading and file/workspace counts, errors vs warnings, the hidden-errors indicator, the passed-verification state, and the context view sections.
- Add
vitest run to test.yml.
References:
Why:
client/src/webview/views/**is where most recent UI changes land. These functions take diagnostics or context data and return HTML, with novscodeimport, so they can be tested in milliseconds without starting VS Code.What:
src/**/*.spec.ts, excluded from the extension build).vitest runtotest.yml.References:
npm run unit-test) before its integration tests: https://github.com/golang/vscode-go/blob/master/.github/workflows/test-smoke.yml