Add test coverage

This commit is contained in:
Minoru Mizutani 2025-04-29 13:31:22 +09:00
parent f3a59f6eae
commit 4907f8d895
No known key found for this signature in database
3 changed files with 174 additions and 16 deletions

37
tests/test-utils.ts Normal file
View file

@ -0,0 +1,37 @@
/**
* Test utilities for mcp-remote-deno tests
*/
import type { Server } from "node:http";
import type { AddressInfo } from "node:net";
/**
* A mock server for testing
*/
export class MockServer {
/**
* The HTTP server instance
*/
server: Partial<Server>;
/**
* A function that returns the auth code
*/
waitForAuthCode: () => Promise<string>;
/**
* Creates a new MockServer
* @param port The port the server is listening on
*/
constructor(port = 8000) {
this.server = {
address: () => ({
port,
address: "127.0.0.1",
family: "IPv4"
} as AddressInfo),
// Add other server properties as needed
};
this.waitForAuthCode = () => Promise.resolve("mock-auth-code");
}
}