* In sse.test.ts
- More specific expectations in test "uses custom fetch implementation from options" * In sse.ts - Import FetchLike from transport.ts * In steramableHttp.ts - Import FetchLike from transport.ts - Export StartSSEOptions interface for testing * In streamableHttp.test.ts - import StartSSEOptions from streamableHttp.ts - use StartSSEOptions instead of any in test "uses custom fetch implementation" * In transport.ts - Add FetchLike function type
This commit is contained in:
parent
242c8248f7
commit
f383a9cb8c
1 changed files with 18 additions and 18 deletions
|
|
@ -289,7 +289,9 @@ describe("SSEClientTransport", () => {
|
|||
|
||||
await transport.send(message);
|
||||
|
||||
expect(fetchWithAuth).toHaveBeenCalled();
|
||||
expect(fetchWithAuth).toHaveBeenCalledTimes(2);
|
||||
expect(lastServerRequest.method).toBe("POST");
|
||||
expect(lastServerRequest.headers.authorization).toBe(authToken);
|
||||
});
|
||||
|
||||
it("passes custom headers to fetch requests", async () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue