Skip to content

Migrate to vitest#152

Merged
niemyjski merged 5 commits intomainfrom
chore/vitest-migration
Mar 25, 2026
Merged

Migrate to vitest#152
niemyjski merged 5 commits intomainfrom
chore/vitest-migration

Conversation

@niemyjski
Copy link
Member

No description provided.

Replace Jest-specific package scripts, resolver config, and lint integration with a Vitest workspace setup. Refresh the lockfile and package metadata so the repo resolves source imports through Vitest/Vite instead of the old Jest ESM workaround.
Update the test suite to use Vitest imports and async patterns, add the core test setup needed to shield jsdom tests from Node 25's broken global localStorage, and keep the typed-array normalization fix that the migrated Utils tests now exercise for BigInt views.
Update repo instructions, editor recommendations, and devcontainer defaults so local tooling points at Vitest instead of the removed Jest workflow.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the monorepo test runner from Jest/ts-jest to Vitest, aligning test execution with a Vite-based workflow while updating linting/editor/devcontainer tooling accordingly.

Changes:

  • Add root Vitest multi-project configuration and switch root + workspace test scripts to Vitest.
  • Remove Jest configuration/dependencies and update tests to use vitest APIs (expect, vi, hooks).
  • Update ESLint/VScode/devcontainer/docs to reflect the new testing toolchain and environments.

Reviewed changes

Copilot reviewed 35 out of 36 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
vitest.config.ts Adds Vitest multi-project setup for core/browser/node packages.
package.json Switches root test scripts to Vitest; updates devDependencies (Vitest + jsdom + eslint plugin).
eslint.config.mjs Replaces Jest ESLint integration with Vitest ESLint integration; updates ignores.
jest-resolver.cjs Removes custom Jest resolver used for TS/ESM import compatibility.
packages/core/package.json Removes Jest config/deps; routes tests to root Vitest project.
packages/browser/package.json Removes Jest config/deps; routes tests to root Vitest project.
packages/node/package.json Removes Jest config/deps; routes tests to root Vitest project; updates node engine.
packages/react/package.json Removes Jest devDependencies from react package.
packages/core/tsconfig.json Removes Jest types from TS config.
packages/browser/tsconfig.json Removes Jest types from TS config.
packages/node/tsconfig.json Removes Jest types from TS config.
packages/core/test/setup.ts Adds shared test setup (localStorage handling/cleanup).
packages/core/test/storage/StorageTestBase.ts Updates test helper imports to Vitest APIs.
packages/core/test/submission/TestSubmissionClient.test.ts Migrates mocks from jest to vi.
packages/core/test/queue/DefaultEventQueue.test.ts Updates setup assertions and refactors conditional expectations.
packages/core/test/plugins/default/EventExclusionPlugin.test.ts Migrates to Vitest imports.
packages/core/test/plugins/default/DuplicateCheckerPlugin.test.ts Migrates to Vitest imports.
packages/core/test/plugins/default/ConfigurationDefaultsPlugin.test.ts Migrates to Vitest imports.
packages/core/test/plugins/EventPluginManager.test.ts Migrates to Vitest imports.
packages/core/test/configuration/Configuration.test.ts Reworks async test from done callback to Promise-based completion (Vitest-friendly).
packages/core/test/Utils.test.ts Migrates to Vitest imports and simplifies assertions.
packages/core/test/ExceptionlessClient.test.ts Migrates to Vitest imports.
packages/core/src/Utils.ts Adjusts TypedArray handling in prune implementation.
packages/browser/test/plugins/BrowserIgnoreExtensionErrorsPlugin.test.ts Migrates to Vitest imports.
packages/browser/test/plugins/BrowserErrorPlugin.test.ts Migrates to Vitest imports.
packages/node/test/storage/NodeDirectoryStorage.test.ts Makes test data directory path stable via import.meta.url + path.
example/react/src/setupTests.js Removes Jest-specific test setup file.
example/react/package.json Removes Jest-specific eslint config/dependency for the example app.
AGENTS.md Updates testing framework documentation to Vitest.
.vscode/settings.json Removes Jest extension configuration.
.vscode/launch.json Updates launch configs to run Vitest instead of Jest.
.vscode/extensions.json Updates recommended extensions from Jest tooling to Vitest tooling.
.devcontainer/devcontainer.json Updates devcontainer extensions and switches install to npm ci.
.claude/agents/pr-reviewer.md Updates guidance text to reference Vitest.
.claude/agents/engineer.md Updates guidance text to reference Vitest.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The build workflow published branch prerelease packages without an explicit dist-tag and used overly broad publish gating, causing push builds to fail and making CI package tags unsafe.
Explicitly set the shell to bash for build steps that utilize bash-specific syntax, such as parameter expansion, to ensure consistent behavior across different runner environments.
@niemyjski niemyjski merged commit e3def88 into main Mar 25, 2026
11 checks passed
@niemyjski niemyjski deleted the chore/vitest-migration branch March 25, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants