MCPcopy
hub / github.com/coder/mux / createMockServer

Function createMockServer

src/node/utils/oauthFlowManager.test.ts:17–25  ·  view source on GitHub ↗

* Minimal mock that satisfies the `http.Server` contract used by * OAuthFlowManager: only `close()` is called (via `closeServer`).

()

Source from the content-addressed store, hash-verified

15 * OAuthFlowManager: only `close()` is called (via `closeServer`).
16 */
17function createMockServer(): http.Server {
18 const mock = {
19 close: (cb?: (err?: Error) => void) => {
20 if (cb) cb();
21 return mock;
22 },
23 } as unknown as http.Server;
24 return mock;
25}
26
27/** Create a fresh OAuthFlowEntry backed by a mock server. */
28function createFlowEntry(server?: http.Server | null): OAuthFlowEntry {

Callers 1

createFlowEntryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected