Migrate to vitest from jest#1074
Merged
pcarleton merged 12 commits intomodelcontextprotocol:mainfrom Nov 14, 2025
Merged
Conversation
Contributor
Author
|
The main motivation to do this is that vitest works with ESM modules natively. This means we can use MSW to test MCP servers more effectively. MSW is a lovely tool and is pretty much standard practise when testing typescript servers. |
Contributor
|
Fully support this. Was discussed in #1015 and #916 but not progressed. Additionally other repos are already migrating (e.g. modelcontextprotocol/servers#2884). It only makes sense that we do it here too! |
Contributor
67c9989 to
29cb080
Compare
commit: |
felixweinberger
approved these changes
Nov 13, 2025
pcarleton
requested changes
Nov 13, 2025
Member
pcarleton
left a comment
There was a problem hiding this comment.
overall looks good, ty for doing this. just had 2 questions about parts i didn't understand
Replace remaining Jest-specific APIs with Vitest equivalents: - jest.Mock -> Mock (already imported from vitest) - jest.fn() -> vi.fn() - Add non-null assertion for TypeScript strict null check
Contributor
|
@mattzcarey pushed a fix for the failing CI |
pcarleton
approved these changes
Nov 14, 2025
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.

its newer, faster, works natively with the modern toolchain like typescript.
Motivation and Context
How Has This Been Tested?
Breaking Changes
Types of changes
Checklist
Additional context