(req: IncomingMessage, res: ServerResponse)
| 27 | function setupServiceWorkerFixture(server: TestServer): {received: string[]} { |
| 28 | const received: string[] = []; |
| 29 | const json = (req: IncomingMessage, res: ServerResponse) => { |
| 30 | received.push(req.url ?? ''); |
| 31 | res.writeHead(200, { |
| 32 | 'content-type': 'application/json', |
| 33 | 'cache-control': 'no-store', |
| 34 | }); |
| 35 | res.end('{"secret":"BLOCKED-DATA"}'); |
| 36 | }; |
| 37 | server.addRoute('/blocked/data.json', json); |
| 38 | server.addRoute('/blocked/swdata.json', json); |
| 39 | server.addRoute('/sw.js', (req, res) => { |
nothing calls this directly
no outgoing calls
no test coverage detected