-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Update test framework to vitest #2884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Update test framework to vitest #2884
Conversation
- Replace Jest dependencies with Vitest and @vitest/coverage-v8 - Update test scripts to use 'vitest run --coverage' - Create vitest.config.ts for both servers with node environment and coverage settings - Update all test files: - Change imports from '@jest/globals' to 'vitest' - Replace jest.mock() with vi.mock() - Replace jest.fn() with vi.fn() - Update mock clearing/restoring to use vi methods - Remove jest.config.cjs files - All 151 tests passing (24 in sequentialthinking, 127 in filesystem) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
|
||
| ## Testing | ||
|
|
||
| Use vitest when configuring or adding tests for servers implemented in typescript. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this applies to both humans + agents I might move this to README/CONTRIBUTING directly
| @@ -0,0 +1,9 @@ | |||
| # MCP Reference Server Development Guide | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? From my experience most coding agents seem to already read README + CONTRIBUTING.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
Fixes: #2882
Description
This PR migrates the test frameworks for the
sequentialthinkingandfilesystemservers from Jest to Vitest. This migration provides faster test execution, better ESM support, and a more modern testing experience while maintaining 100% test compatibility.I also added a AGENTS.md file which gets imported into a repo-level CLAUDE.md as well, to help refer agents to the preferred test framework and contributing guidelines that humans might miss.
Server Details
Motivation and Context
The current Jest setup with ts-jest requires extensive configuration to handle ESM modules, leading to:
This migration simplifies the testing infrastructure while maintaining the same test coverage and reliability.
How Has This Been Tested?
All tests have been executed successfully with Vitest.
Breaking Changes
None.
Types of changes
Checklist