MCPcopy Index your code
hub / github.com/oakserver/oak / fn

Function fn

http_server_native.test.ts:18–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16 name: "NativeRequest",
17 ignore: isNode(),
18 async fn() {
19 const respondWithStack: Array<Response | Promise<Response>> = [];
20 const request = new Request("http://localhost:8000/", {
21 method: "POST",
22 body: `{"a":"b"}`,
23 });
24 const remoteAddr = createMockNetAddr();
25 const nativeRequest = new NativeRequest(request, { remoteAddr });
26 assertEquals(nativeRequest.url, `/`);
27 const response = new Response("hello deno");
28 nativeRequest.respond(response);
29 respondWithStack.push(await nativeRequest.response);
30 assertStrictEquals(await respondWithStack[0], response);
31 },
32});
33
34Deno.test({

Callers

nothing calls this directly

Calls 8

respondMethod · 0.95
listenMethod · 0.95
closeMethod · 0.95
createMockNetAddrFunction · 0.85
fetchFunction · 0.85
textMethod · 0.80
respondMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected