Skip to content

Commit c06a097

Browse files
committed
fix(types): resolve TypeScript errors in server-launcher.ts
- Initialize lastError variable to satisfy definite assignment check - Remove unsupported STDIO transport mode case and check - Simplify HTTP server wait logic since all modes are HTTP-based now
1 parent 76e2233 commit c06a097

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

tests/manual/utils/server-launcher.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ export async function launchServer(config: ServerConfig): Promise<ServerInstance
7070
serverEnv.STREAMABLE_HTTP = "true";
7171
serverEnv.PORT = port.toString();
7272
break;
73-
case TransportMode.STDIO:
74-
// Stdio mode doesn't need port configuration - uses process communication
75-
throw new Error(
76-
`${TransportMode.STDIO} mode is not supported for server testing, because it uses process communication.`
77-
);
7873
}
7974

8075
const serverPath = path.resolve(process.cwd(), "dist/main.js");
@@ -146,11 +141,7 @@ async function waitForServerStart(
146141
process.stderr?.removeListener("data", onData);
147142

148143
// Additional wait for HTTP servers to be fully ready
149-
if (mode !== TransportMode.STDIO) {
150-
setTimeout(resolve, 1000);
151-
} else {
152-
resolve();
153-
}
144+
setTimeout(resolve, 1000);
154145
}
155146
};
156147

@@ -237,7 +228,7 @@ export async function checkHealthEndpoint(
237228
port: number,
238229
maxRetries: number = 5
239230
): Promise<HealthCheckResponse> {
240-
let lastError: Error;
231+
let lastError: Error = new Error("Health check failed - no attempts made");
241232

242233
for (let i = 0; i < maxRetries; i++) {
243234
try {

0 commit comments

Comments
 (0)