feat: add e2e testing with @vscode/test-cli and wire it into CI - #60
Merged
Conversation
Adds a real integration-testing layer alongside the vitest unit
suite: test/e2e/*.test.ts runs against the built extension inside an
actual VS Code Extension Development Host (@vscode/test-cli +
@vscode/test-electron), exercising command registration, the tree
view, and workspaceState through the real vscode API instead of the
vitest mock. activate() now returns a small { store, provider } API
so e2e tests can inspect state the UI alone doesn't expose.
Wires `npm run test:e2e` into a new CI job (xvfb-run on Linux), and
updates the Definition of Done in CLAUDE.md to require e2e coverage
for new user-facing commands/tree behavior alongside unit tests, not
as a substitute for them.
Also overrides mocha's stale diff/serialize-javascript transitive
deps to close a high-severity npm audit finding pulled in by
@vscode/test-cli.
…tegration-tests # Conflicts: # extension.ts
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test/e2e/*.test.tsruns against the built extension inside an actual VS Code Extension Development Host (@vscode/test-cli+@vscode/test-electron), exercising command registration, the tree view, andworkspaceStatethrough the realvscodeAPI instead oftest/vscode-mock.ts.activate()now returns a small{ store, provider }API so e2e tests can inspect state the tree view UI alone doesn't expose.npm run test:e2e(pretest:e2ebuilds the extension + bundlestest/e2e/**with esbuild, thenvscode-testlaunches the real test host).e2eCI job (xvfb-runon Linux) runs it on every push/PR alongside the existingbuildjob.CLAUDE.md: new user-facing commands/tree behavior now need an e2e test in addition to unit tests, not instead of them.diff/serialize-javascripttransitive deps (pulled in by@vscode/test-cli) to close a high-severitynpm auditfinding neither package has released a compatible fix for yet.Test plan
npm run lintnpm run test:coverage— 100% statements/lines, 93.02% branchesnpm run buildnpm run test:e2e— 4/4 passing against a real VS Code 1.134.0 instancenpm audit --audit-level=high— 0 vulnerabilitiesscripts/local-patch-report.sh— 100% patch coverage (1/1)