mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-22 22:05:28 +02:00
Trim low-value tests per review feedback
Removed ~29 tests that were adding noise rather than coverage: - Registration boilerplate tests (16): redundant with registrations.test.ts - Redundant role/type checks (3): consolidated into behavioral tests - "Should not throw" tests (6): consolidated into single lifecycle test - Constant identity tests (2): provided no safety net - expect(true).toBe(true) test (1): replaced with actual assertion - Weak capability test (1): removed, handler check already exists Strengthened remaining tests: - Resource templates test now verifies specific resource names - File resources test now asserts registerResource was called Test count: 124 → 95 (29 removed) Coverage unchanged at ~71% Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,25 +23,10 @@ describe('Server Factory', () => {
|
||||
expect(server.server).toBeDefined();
|
||||
});
|
||||
|
||||
it('should have tools capability enabled', () => {
|
||||
it('should have an oninitialized handler set', () => {
|
||||
const { server } = createServer();
|
||||
|
||||
// Server should be properly configured
|
||||
expect(server).toBeDefined();
|
||||
});
|
||||
|
||||
it('should cleanup without throwing errors', () => {
|
||||
const { cleanup } = createServer();
|
||||
|
||||
// Cleanup should not throw when called with a session ID
|
||||
expect(() => cleanup('test-session')).not.toThrow();
|
||||
});
|
||||
|
||||
it('should cleanup without throwing errors when sessionId is undefined', () => {
|
||||
const { cleanup } = createServer();
|
||||
|
||||
// Cleanup should not throw when called without a session ID
|
||||
expect(() => cleanup()).not.toThrow();
|
||||
expect(server.server.oninitialized).toBeDefined();
|
||||
});
|
||||
|
||||
it('should allow multiple servers to be created', () => {
|
||||
@@ -52,11 +37,5 @@ describe('Server Factory', () => {
|
||||
expect(result2.server).toBeDefined();
|
||||
expect(result1.server).not.toBe(result2.server);
|
||||
});
|
||||
|
||||
it('should have an oninitialized handler set', () => {
|
||||
const { server } = createServer();
|
||||
|
||||
expect(server.server.oninitialized).toBeDefined();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user