(handler)
| 16 | // Sets up an HTTP server with the given response handler and calls fetch() to |
| 17 | // obtain a Response from the newly created server. |
| 18 | async function testRequest(handler) { |
| 19 | const server = createServer((_, res) => handler(res)).unref().listen(0); |
| 20 | await events.once(server, 'listening'); |
| 21 | const { port } = server.address(); |
| 22 | return fetch(`http://127.0.0.1:${port}/foo.wasm`); |
| 23 | } |
| 24 | |
| 25 | // Runs the given function both with the promise itself and as a continuation |
| 26 | // of the promise. We use this to test that the API accepts not just a Response |
no test coverage detected
searching dependent graphs…