From 322f39d490f05cd3fc4472b727b02a5c6186e81c Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sat, 2 Jun 2018 16:01:58 +0200 Subject: [PATCH] test: minor adjustments to test-http2-respond-file Backport-PR-URL: https://github.com/nodejs/node/pull/22850 PR-URL: https://github.com/nodejs/node/pull/21098 Reviewed-By: Anatoli Papirovski Reviewed-By: Rich Trott Reviewed-By: Jon Moss Reviewed-By: Richard Lau --- test/parallel/test-http2-respond-file.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-http2-respond-file.js b/test/parallel/test-http2-respond-file.js index 9ad8e7a69648dc..1c10ceb4350723 100644 --- a/test/parallel/test-http2-respond-file.js +++ b/test/parallel/test-http2-respond-file.js @@ -19,7 +19,7 @@ const data = fs.readFileSync(fname); const stat = fs.statSync(fname); const server = http2.createServer(); -server.on('stream', (stream) => { +server.on('stream', common.mustCall((stream) => { stream.respondWithFile(fname, { [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain' }, { @@ -28,9 +28,9 @@ server.on('stream', (stream) => { headers[HTTP2_HEADER_CONTENT_LENGTH] = stat.size; } }); -}); -server.listen(0, () => { +})); +server.listen(0, common.mustCall(() => { const client = http2.connect(`http://localhost:${server.address().port}`); const req = client.request(); @@ -49,4 +49,4 @@ server.listen(0, () => { server.close(); })); req.end(); -}); +}));