@@ -2,7 +2,7 @@ import { StreamableHttpRunner } from "../../../src/transports/streamableHttp.js"
22import { Client } from "@modelcontextprotocol/sdk/client/index.js" ;
33import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js" ;
44import { describe , expect , it } from "vitest" ;
5- import { TransportRunnerConfig } from "../../../src/lib.js" ;
5+ import type { TransportRunnerConfig } from "../../../src/lib.js" ;
66import { defaultTestConfig } from "../helpers.js" ;
77
88describe ( "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