Migrate to vitest from jest - #1074
Conversation
|
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. |
|
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! |
67c9989 to
29cb080
Compare
commit: |
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
|
@mattzcarey pushed a fix for the failing CI |
|
I also noticed that Vitest is used across several repositories, and that there was a migration from Jest to Vitest. I left a more detailed comment in the server repository here: modelcontextprotocol/servers#2884 (comment) |
|
This migration introduced |

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