| 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 | |
| 34 | Deno.test({ |