clean up tests - remove mockRequestInfo

This commit is contained in:
Konstantin Konstantinov 2025-06-25 16:24:30 +03:00
commit 606c278668
No known key found for this signature in database

View file

@ -15,19 +15,11 @@ import {
ListResourcesRequestSchema,
ListToolsRequestSchema,
SetLevelRequestSchema,
ErrorCode,
ErrorCode
} from "../types.js";
import { Transport } from "../shared/transport.js";
import { InMemoryTransport } from "../inMemory.js";
import { Client } from "../client/index.js";
import { RequestInfo } from "./types/types.js";
const mockRequestInfo: RequestInfo = {
headers: {
'content-type': 'application/json',
'traceparent': '00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01',
},
};
test("should accept latest protocol version", async () => {
let sendPromiseResolve: (value: unknown) => void;
@ -86,7 +78,7 @@ test("should accept latest protocol version", async () => {
version: "1.0",
},
},
}, { requestInfo: mockRequestInfo });
});
await expect(sendPromise).resolves.toBeUndefined();
});
@ -147,7 +139,7 @@ test("should accept supported older protocol version", async () => {
version: "1.0",
},
},
}, { requestInfo: mockRequestInfo });
});
await expect(sendPromise).resolves.toBeUndefined();
});
@ -207,7 +199,7 @@ test("should handle unsupported protocol version", async () => {
version: "1.0",
},
},
}, { requestInfo: mockRequestInfo });
});
await expect(sendPromise).resolves.toBeUndefined();
});