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:
Niels Kaspers
2026-02-06 22:59:19 +02:00
parent 9c0921276c
commit 0ca9921e20
5 changed files with 33 additions and 348 deletions

View File

@@ -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();
});
});
});