GLSP-1635: Migrate test stack to Vitest - #1705
Merged
Merged
Conversation
- Replace the Mocha/nyc/chai/sinon stack with Vitest and its v8 coverage provider across the monorepo - Add the @eclipse-glsp/vitest-config package providing a ready-to-use shared flat config; drop the now-obsolete mocha-config and nyc-config packages - Rework the config-test meta package to bundle the Vitest config and test dependencies in place of Mocha and nyc - Port all CLI specs to the Vitest API (chai expect, sinon sandboxes/ stubs → vitest expect/vi) and add vite.config.ts/vite.config.e2e.ts - Update CLI and root scripts/dependencies accordingly and drop the bespoke coverage-report command in favor of vitest --coverage Also: - Switch the CI test workflow to Vitest Part of: #1635
tortmayr
force-pushed
the
GLSP-1635-vitest-migration
branch
from
June 21, 2026 12:23
6bac7a2 to
de71e6d
Compare
There was a problem hiding this comment.
Pull request overview
Migrates the monorepo’s shared test tooling from the Mocha/nyc/chai/sinon stack to Vitest, introducing a reusable @eclipse-glsp/vitest-config package and updating CLI tests/configuration and CI accordingly.
Changes:
- Replace Mocha/nyc-based test + coverage setup with Vitest +
@vitest/coverage-v8, including new shared Vitest flat config. - Update CLI unit/e2e tests from chai/sinon to Vitest APIs and add
vite.config.ts/vite.config.e2e.ts. - Remove obsolete Mocha/nyc config packages and adjust workspace hoisting/scripts and the GitHub Actions test workflow.
Reviewed changes
Copilot reviewed 62 out of 65 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.eslint.json | Extend ESLint TS coverage to include vite.config*.ts files. |
| pnpm-workspace.yaml | Update workspace hoisting patterns and add peer-install setting; keep security overrides. |
| package.json | Simplify root devDependencies and align root test scripts with Vitest-based CLI tests. |
| dev-packages/vitest-config/README.md | New documentation for the shared Vitest config package. |
| dev-packages/vitest-config/package.json | Define the new @eclipse-glsp/vitest-config package metadata/exports/peers. |
| dev-packages/vitest-config/LICENSE | Add license file for the new package. |
| dev-packages/vitest-config/index.js | Implement the shared Vitest config (restoreMocks, include globs, v8 coverage, CI reporter). |
| dev-packages/vitest-config/index.d.ts | Provide types for the shared Vitest config package exports. |
| dev-packages/ts-config/tsconfig.json | Remove reflect-metadata from default types. |
| dev-packages/ts-config/package.json | Stop publishing the removed Mocha-specific tsconfig variant. |
| dev-packages/ts-config/mocha.json | Remove Mocha-specific tsconfig variant. |
| dev-packages/nyc-config/README.md | Remove obsolete nyc shared config documentation. |
| dev-packages/nyc-config/package.json | Remove obsolete nyc shared config package. |
| dev-packages/nyc-config/LICENSE | Remove obsolete nyc shared config license file. |
| dev-packages/nyc-config/index.json | Remove obsolete nyc shared config payload. |
| dev-packages/mocha-config/README.md | Remove obsolete Mocha shared config documentation. |
| dev-packages/mocha-config/.mocharc.json | Remove obsolete Mocha shared config payload. |
| dev-packages/config/package.json | Drop reflect-metadata from shared dev config dependencies. |
| dev-packages/config-test/README.md | Update meta test package docs to reference Vitest config usage. |
| dev-packages/config-test/package.json | Switch meta test package deps from Mocha/nyc/chai/sinon to Vitest + coverage-v8 + vitest-config. |
| dev-packages/cli/vite.config.ts | Add repo-root Vitest config entrypoint for CLI unit tests. |
| dev-packages/cli/vite.config.e2e.ts | Add CLI e2e Vitest config with extended timeouts and different include globs. |
| dev-packages/cli/tsconfig.json | Switch CLI TS config base from removed Mocha variant to the shared base config. |
| dev-packages/cli/tests/e2e/update-next.e2e.spec.ts | Port e2e test to Vitest imports. |
| dev-packages/cli/tests/e2e/repo/repo-vscode.e2e.spec.ts | Port e2e test to Vitest lifecycle APIs. |
| dev-packages/cli/tests/e2e/repo/repo-theia.e2e.spec.ts | Port e2e test to Vitest lifecycle APIs. |
| dev-packages/cli/tests/e2e/repo/repo-eclipse.e2e.spec.ts | Port e2e test to Vitest and use conditional skipping via skipIf. |
| dev-packages/cli/tests/e2e/repo/repo-core-clone.e2e.spec.ts | Port e2e test to Vitest and use it.skipIf. |
| dev-packages/cli/tests/e2e/repo/repo-core-build.e2e.spec.ts | Port e2e test to Vitest lifecycle APIs. |
| dev-packages/cli/tests/e2e/releng/version.e2e.spec.ts | Port releng e2e tests to Vitest and use conditional suite skipping via skipIf. |
| dev-packages/cli/tests/e2e/releng/prepare.e2e.spec.ts | Port releng e2e tests to Vitest and use conditional suite skipping via skipIf. |
| dev-packages/cli/tests/e2e/generate-index.e2e.spec.ts | Port e2e test to Vitest imports. |
| dev-packages/cli/tests/e2e/coverage-report.e2e.spec.ts | Remove e2e tests for the removed coverageReport command. |
| dev-packages/cli/tests/e2e/check-header.e2e.spec.ts | Port e2e test to Vitest imports. |
| dev-packages/cli/src/util/validation-util.spec.ts | Port unit tests from sinon sandboxes to vi.spyOn. |
| dev-packages/cli/src/util/process-util.spec.ts | Port unit tests to Vitest imports. |
| dev-packages/cli/src/util/package-util.spec.ts | Port unit tests from sinon to vi.spyOn and vi.restoreAllMocks. |
| dev-packages/cli/src/util/glsp-repo-util.spec.ts | Port unit tests to Vitest imports. |
| dev-packages/cli/src/util/git-util.spec.ts | Port unit tests from sinon to vi.spyOn and Vitest mock call assertions. |
| dev-packages/cli/src/util/file-util.spec.ts | Port unit tests to Vitest imports. |
| dev-packages/cli/src/commands/update-next.spec.ts | Port unit tests from sinon to Vitest spies/mocks. |
| dev-packages/cli/src/commands/repo/workspace.spec.ts | Port unit tests to Vitest imports. |
| dev-packages/cli/src/commands/repo/switch.spec.ts | Port unit tests from sinon to Vitest spies/mocks. |
| dev-packages/cli/src/commands/repo/start.spec.ts | Port unit tests to Vitest imports. |
| dev-packages/cli/src/commands/repo/server-node.spec.ts | Port unit tests to Vitest imports. |
| dev-packages/cli/src/commands/repo/run.spec.ts | Port unit tests to Vitest imports. |
| dev-packages/cli/src/commands/repo/repo.spec.ts | Port unit tests to Vitest imports. |
| dev-packages/cli/src/commands/repo/link.spec.ts | Port unit tests from sinon to Vitest spies/mocks and mock call assertions. |
| dev-packages/cli/src/commands/repo/fork.spec.ts | Port unit tests from sinon to Vitest spies/mocks and mock call assertions. |
| dev-packages/cli/src/commands/repo/common/utils.spec.ts | Port unit tests to Vitest imports. |
| dev-packages/cli/src/commands/repo/clone.spec.ts | Port unit tests from sinon to Vitest spies/mocks and mock call assertions. |
| dev-packages/cli/src/commands/repo/build.spec.ts | Port unit tests from sinon to Vitest spies/mocks and mock call assertions. |
| dev-packages/cli/src/commands/releng/version.spec.ts | Port unit tests to Vitest imports. |
| dev-packages/cli/src/commands/releng/publish.spec.ts | Port unit tests from sinon to Vitest spies/mocks and mock call assertions. |
| dev-packages/cli/src/commands/releng/common.spec.ts | Port unit tests from sinon to Vitest spies/mocks. |
| dev-packages/cli/src/commands/coverage-report.ts | Remove the bespoke nyc-based coverage report command. |
| dev-packages/cli/src/cli.ts | Remove registration of the removed coverageReport command. |
| dev-packages/cli/src/cli.spec.ts | Remove CLI tests for the removed coverageReport command and port remaining tests to Vitest. |
| dev-packages/cli/README.md | Remove CLI documentation for the removed coverageReport command. |
| dev-packages/cli/package.json | Switch test scripts to Vitest and add config-test dependency. |
| dev-packages/cli/.nycrc | Remove nyc configuration (no longer used). |
| dev-packages/cli/.mocharc.json | Remove Mocha configuration (no longer used). |
| dev-packages/cli/.mocharc.e2e.json | Remove Mocha e2e configuration (no longer used). |
| .github/workflows/test.yml | Switch CI test step from pnpm test:ci + CTRF report publishing to Vitest-based reporting/annotations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
haydar-metin
approved these changes
Jun 22, 2026
4 tasks
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.
What it does
Migrates the shared test stack from Mocha/nyc/chai/sinon to Vitest.
provider across the monorepo
@eclipse-glsp/vitest-configpackage providing a ready-to-useshared flat config (explicit test API imports, mock auto-restore, v8
coverage, per-file DOM opt-in, CI annotations), mirroring the sprotty
test setup; drop the now-obsolete
mocha-configandnyc-configpackagesconfig-testmeta package to bundle the Vitest config andtest dependencies in place of Mocha and nyc
expect, sinon sandboxes/stubs→ vitest
expect/vi) and addvite.config.ts/vite.config.e2e.tscoverage-reportcommand in favor ofvitest --coverageAlso:
Part of: #1635
How to test
pnpm testFollow-ups
Consuming GLSP repos (glsp-client, glsp-server-node, etc.) need to migrate
their own test setup to
@eclipse-glsp/vitest-configseparately.Changelog