-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Converted CLI tests to use vitest #1012
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?
Converted CLI tests to use vitest #1012
Conversation
… version, fixed problem with undetected failures (isError: true payloads).
…stry), all tests actually validate what they say they test.
|
@claude can you please review this PR? |
|
Claude finished @cliffhall's task in 1m 58s —— View job PR Review: Convert CLI Tests to VitestGreat work on this comprehensive test migration! This PR significantly improves the CLI test infrastructure. Below is my detailed review. ✅ Strengths1. Solid Test Infrastructure
2. Improved Test Quality
3. Code Quality
4. Configuration
|
… up process termination (possible leak on Windows), beefed up http server cleanup (close all connections), removed unused hasValidJsonOutput, reduced CLI timeout to give it breathing room with vitest timeout.
|
I addressed the valid points from the Claude PR review. This should be ready to merge. |
Summary
CLI tests were implemented in scripts (not any kind of test framework), which caused a number of issues, including tests that "failed" but didn't cause the script to return failure.
Also, none of the tests actually validated the thing being tested - they only validated whether the CLI run produced an error or a "success" (which included MCP protocol responses with isError: true).
Type of Change
Changes Made
Implemented all existing CLI tests in vitest, removed old script-based CLI tests. Updated all tests to ensure they actually validate the thing the test is supposed to test. Remove all references to server-everything and any other registry provided servers. All tests now use an MCP server test harness implemented within the test infra - a stdio server that collects cwd, env vars, and params and reports them as resources for validation, or an sse/http composable and instrumented test server that can provide headers, message replay, detailed metadata, etc).
Testing
Test Results and/or Instructions
Run all tests via
npn run test- all 85 tests should pass.Checklist
npm run prettier-fix)Breaking Changes
No
Additional Context
Updated
npm testtarget, so CI should work properly (but not tested)