Repository navigation
Migrate tests to @vscode/test-cli - #29
Merged
Merged
Conversation
Replace the hand-written mocha harness (test/index.ts and test/runTests.ts) with @vscode/test-cli, configured in .vscode-test.mjs. test-cli defaults mocha to the tdd UI, so the config keeps the bdd UI and color output the old harness set. Rename test/packwerk.ts to packwerk.test.ts so the *.test.js glob picks it up; the old harness loaded every compiled file in out/test. Upgrade @vscode/test-electron to 3.x, which finds the macOS executable that VS Code 1.110+ renamed from Electron to Code. 2.5.2 failed to launch it with spawn ENOENT, so yarn test now works locally on macOS again. Drop the direct mocha dependency, since test-cli brings its own. The "Launch Tests" debug configuration pointed at the removed harness, so recommend the Extension Test Runner extension for running and debugging tests in the editor instead.
This was referenced Sep 30, 2026
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.
Follow-up to #27. Replaces the hand-written mocha harness with
@vscode/test-cli, the official VS Code extension test runner.Changes
test/index.tsandtest/runTests.ts.yarn testnow runsvscode-test, configured in.vscode-test.mjs. test-cli defaults mocha to thetddUI, so the config keeps thebddUI and color output the old harness set.test/packwerk.tstotest/packwerk.test.tsso theout/test/**/*.test.jsglob picks it up. The old harness loaded every compiled file inout/test, so this test ran before and still runs.@vscode/test-electron2.5.2 → 3.1.0: 3.x finds the macOS executable that VS Code 1.110+ renamed fromElectrontoCode.yarn testfailed locally on macOS withspawn … ENOENTand now works.mochadev dependency, since test-cli brings its own (mocha 11). Theserialize-javascriptresolution from Resolve Dependabot alerts and add npm to Dependabot config #27 is still needed, because mocha 11 pins^6.0.2..vscode/extensions.jsonrecommends the Extension Test Runner for running and debugging tests from the Testing view, andvsc-extension-quickstart.mdnow describes that..vscode-test.mjsto.vscodeignore.vsce lsconfirms it's excluded.Testing
yarn install --frozen-lockfile,yarn lint, andyarn run vscode:prepublishpass.yarn testpasses all 13 tests locally on macOS, with no workaround needed.yarn testreported1 failingand exited 1, so CI will still fail on test failures.yarn auditreports one low-severity advisory indiff7.0.0 (GHSA-73rr-hh4g-fpgx). It's already on main via sinon, and Dependabot auto-dismissed it (#40). mocha 11 now uses that same copy.