()
| 20 | } |
| 21 | |
| 22 | async function main() { |
| 23 | const server = await createServer(); |
| 24 | const req = http.get({ |
| 25 | port: server.address().port, |
| 26 | }, common.mustCall((res) => { |
| 27 | const chunks = []; |
| 28 | res.on('data', common.mustCallAtLeast((c) => chunks.push(c), 1)); |
| 29 | res.on('end', common.mustCall(() => { |
| 30 | const body = Buffer.concat(chunks).toString('utf8'); |
| 31 | const data = JSON.parse(body); |
| 32 | assert.strictEqual(data.hello, 'world'); |
| 33 | })); |
| 34 | })); |
| 35 | const timer = setInterval(global.gc, 300); |
| 36 | onGC(req, { |
| 37 | ongc: common.mustCall(() => { |
| 38 | clearInterval(timer); |
| 39 | server.close(); |
| 40 | }) |
| 41 | }); |
| 42 | } |
| 43 | |
| 44 | main(); |
no test coverage detected