test(vscode): in-editor smoke harness via @vscode/test-electron (Closes #139)#317
Merged
Conversation
#139) Adds editors/vscode/test/ — a headless extension-host runner that loads the compiled out/extension.cjs in a real VS Code and asserts the four acceptance bullets from #139: 1. activation without error 2. all five affinescript.* commands register and invoke 3. restartLsp cycles cleanly (back-to-back invocations resolve) 4. deactivate resolves without throwing Wires a vscode-smoke job into .github/workflows/ci.yml (Node 20 + xvfb-run + `npm test`). The compiled extension.cjs is already checked in (#35 Phase 3), so the smoke job needs only the Node-side test deps — not the OCaml toolchain. The Node-only runner is recorded as the second Runtime Exemption in .claude/CLAUDE.md, paralleling the existing affine-vscode-publish.yml carve-out (#104). Scope is strictly editors/vscode/test/; no production code adopts Node. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
hyperpolymath
added a commit
that referenced
this pull request
May 21, 2026
* test(vscode): in-editor smoke harness via @vscode/test-electron (Closes #139) Adds editors/vscode/test/ — a headless extension-host runner that loads the compiled out/extension.cjs in a real VS Code and asserts the four acceptance bullets from #139: 1. activation without error 2. all five affinescript.* commands register and invoke 3. restartLsp cycles cleanly (back-to-back invocations resolve) 4. deactivate resolves without throwing Wires a vscode-smoke job into .github/workflows/ci.yml (Node 20 + xvfb-run + `npm test`). The compiled extension.cjs is already checked in (#35 Phase 3), so the smoke job needs only the Node-side test deps — not the OCaml toolchain. The Node-only runner is recorded as the second Runtime Exemption in .claude/CLAUDE.md, paralleling the existing affine-vscode-publish.yml carve-out (#104). Scope is strictly editors/vscode/test/; no production code adopts Node. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(vscode): document #139 smoke harness in README + CAPABILITY-MATRIX - editors/vscode/README.md gains a "Smoke testing the compiled extension" subsection under Contributing: run instructions, what the harness asserts, the LSP-attach env-var escape hatch, pointer to the Runtime Exemption in CLAUDE.md. - docs/CAPABILITY-MATRIX.adoc Node-CJS row gains the live-host smoke status (was missing — the row only attested the .cjs compile path). Refs #139, PR #317. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
editors/vscode/test/— a headless extension-host runner that loads the compiledout/extension.cjsin a real VS Code via@vscode/test-electronand asserts the four acceptance bullets from [QA] In-editor end-to-end smoke test for the .affine VS Code extension #139.vscode-smokejob into.github/workflows/ci.yml(Node 20 +xvfb-run+npm test). The compiledextension.cjsis already checked in (Add Node-target backend + vscode-API bindings to enable .affine VS Code extensions #35 Phase 3) so the smoke job does not need the OCaml toolchain — only the Node-side test deps..claude/CLAUDE.md, paralleling the existingaffine-vscode-publish.ymlcarve-out (Publish @hyperpolymath/affine-vscode to npm (eliminate vendoring) #104). Scope is strictlyeditors/vscode/test/; no production code adopts Node.Acceptance-criteria mapping (from #139)
AC1—extensions.getExtension(...).activate()resolves;isActiveis trueaffinescript.{check,eval,compile,format,restartLsp}register and runAC2a— all five appear ingetCommands(true).AC2b—executeCommandon each resolves without throwingrestartLspcycles it cleanlyAC3— two back-to-backrestartLspinvocations both resolve. (Full attach path activates only whenaffinescript-lspis onPATH; CI exercises the documentedshowWarningMessageshort-circuit. SetAFFINESCRIPT_LSP_PATHto a real binary to drive the attach branch.)deactivateAC4— calls the extension's exporteddeactivate()and asserts it resolves without throwingFiles
editors/vscode/test/runTest.js— driver: downloads VS Code, launches with--extensionDevelopmentPath+--extensionTestsPath.editors/vscode/test/suite/index.js— Mocha entry the host invokes; discovers*.test.js.editors/vscode/test/suite/extension.test.js— the four acceptance tests above.editors/vscode/package.json— adds@vscode/test-electron,mocha,globtodevDependencies; addsnpm testscript..github/workflows/ci.yml— newvscode-smokejob..claude/CLAUDE.md— second Runtime Exemption row.Test plan
editors/vscode/, fetch deps and runxvfb-run npm test(ornpm teston a desktop session) — all four acceptance tests pass against the checked-inout/extension.cjs.vscode-smokejob goes green on this PR..vsixin VS Code, open a.affinefile, run each of the five commands — observed behaviour matches what the harness asserts.Closes #139.
Generated with Claude Code