Draft
Conversation
- Replace jest, ts-jest, @types/jest with vitest and @vitest/coverage-v8 - Add vitest.config.ts with globals, test matching, timeout, and coverage - Update package.json scripts (ts.test: vitest run) - Remove jest config from package.json - Remove test-exclude override (no longer needed) - Convert require() to import in src/index.ts for vitest compatibility - Add vitest/globals types and skipLibCheck to tsconfig.json - Exclude vitest.config.ts from tsc and eslint Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
mikeharder
March 20, 2026 05:52
View session
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
Migrates the test framework from Jest (v30) to Vitest (v4.1.0), the latest version.
Changes
Dependencies
jest(^30.1.3),ts-jest(^29.1.4),@types/jest(^30.0.0)vitest(^4.1.0),@vitest/coverage-v8(^4.1.0)test-excludeoverride frompackage.json(was only needed by Jest's coverage tooling)Configuration
vitest.config.tswith equivalent settings:globals: true— providestest,describe,it,test.eachglobals (matching Jest behavior)include: ["**/*[tT]est.ts"]— same test file matching patterntestTimeout: 100000— same 100s timeoutcoverage.enabled: true— same as Jest'scollectCoverage: truejestconfig section frompackage.jsonts.testscript fromjesttovitest runTypeScript Configuration
"types": ["vitest/globals"]totsconfig.json(replaces@types/jest)"skipLibCheck": true(needed because vitest's type declarations use modernexportsthat requirenode16/bundlermodule resolution, while this project uses legacycommonjsmodule resolution)vitest.config.tstoexclude(required becauserootDiris./src)vitest.config.tsto eslintignoresSource Change
src/index.ts: Convertedrequire("./lib/util/constants")toexport { Constants } from "./lib/util/constants"— vitest's ESM-based module resolution doesn't support barerequire()calls to TypeScript source files without extensionsVerification
npm run tsc— builds successfullynpm run lint— no warningsnpm run prettier— all files formattednpm run ts.test— 5/5 non-.NET tests pass (18 tests that requiredotnetDLLs fail as expected in this environment, same as with Jest)Migration Notes
test()/describe()/it()globals and Node.jsassertmodule, which are compatible between Jest and Vitesttest.each()API used inincompatiblePropertiesTest.tsworks identically in Vitest