Add Vitest tests for Everything Server

Adds comprehensive test coverage for the Everything Server including:

Tools (10 tools tested):
- echo: message echoing with validation
- get-sum: number addition with edge cases
- get-env: environment variable retrieval
- get-tiny-image: image content blocks
- get-structured-content: weather data for all cities
- get-annotated-message: priority/audience annotations
- trigger-long-running-operation: progress notifications
- get-resource-links: dynamic resource link generation
- get-resource-reference: text/blob resource validation

Prompts (4 prompts tested):
- simple-prompt: no-argument prompt
- args-prompt: city/state arguments
- completable-prompt: department/name completions
- resource-prompt: embedded resource references

Resources:
- templates.ts: URI generation, text/blob resources
- session.ts: session-scoped resource registration

Test infrastructure:
- vitest.config.ts with v8 coverage
- Mock server helper for capturing registered handlers
- 81 tests, all passing

Closes #2925

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Niels Kaspers
2026-01-20 23:58:05 +01:00
parent 10d382798e
commit 93a4f763b6
6 changed files with 1135 additions and 3 deletions

4
package-lock.json generated
View File

@@ -3806,9 +3806,11 @@
"devDependencies": {
"@types/cors": "^2.8.19",
"@types/express": "^5.0.6",
"@vitest/coverage-v8": "^2.1.8",
"prettier": "^2.8.8",
"shx": "^0.3.4",
"typescript": "^5.6.2"
"typescript": "^5.6.2",
"vitest": "^2.1.8"
}
},
"src/filesystem": {