Skip to content

Commit ce72c96

Browse files
committed
chore: fix
1 parent ca85dc9 commit ce72c96

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/integration/transports/createSessionConfig.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { StreamableHttpRunner } from "../../../src/transports/streamableHttp.js"
22
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
33
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
44
import { describe, expect, it } from "vitest";
5-
import { TransportRunnerConfig } from "../../../src/lib.js";
5+
import type { TransportRunnerConfig } from "../../../src/lib.js";
66
import { defaultTestConfig } from "../helpers.js";
77

88
describe("createSessionConfig", () => {
@@ -12,12 +12,11 @@ describe("createSessionConfig", () => {
1212
describe("basic functionality", () => {
1313
it("should use the modified config from createSessionConfig", async () => {
1414
const createSessionConfig: TransportRunnerConfig["createSessionConfig"] = async (userConfig) => {
15-
return {
15+
return Promise.resolve({
1616
...userConfig,
1717
apiBaseUrl: "https://test-api.mongodb.com/",
18-
};
18+
});
1919
};
20-
2120
userConfig.httpPort = 0; // Use a random port
2221
runner = new StreamableHttpRunner({
2322
userConfig,
@@ -122,7 +121,7 @@ describe("createSessionConfig", () => {
122121
describe("error handling", () => {
123122
it("should propagate errors from configProvider on client connection", async () => {
124123
const createSessionConfig: TransportRunnerConfig["createSessionConfig"] = async () => {
125-
throw new Error("Failed to fetch config");
124+
return Promise.reject(new Error("Failed to fetch config"));
126125
};
127126

128127
userConfig.httpPort = 0; // Use a random port

0 commit comments

Comments
 (0)