Skip to content

Commit 322f39d

Browse files
addaleaxBethGriggs
authored andcommitted
test: minor adjustments to test-http2-respond-file
Backport-PR-URL: #22850 PR-URL: #21098 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent b22266c commit 322f39d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/parallel/test-http2-respond-file.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const data = fs.readFileSync(fname);
1919
const stat = fs.statSync(fname);
2020

2121
const server = http2.createServer();
22-
server.on('stream', (stream) => {
22+
server.on('stream', common.mustCall((stream) => {
2323
stream.respondWithFile(fname, {
2424
[HTTP2_HEADER_CONTENT_TYPE]: 'text/plain'
2525
}, {
@@ -28,9 +28,9 @@ server.on('stream', (stream) => {
2828
headers[HTTP2_HEADER_CONTENT_LENGTH] = stat.size;
2929
}
3030
});
31-
});
32-
server.listen(0, () => {
31+
}));
3332

33+
server.listen(0, common.mustCall(() => {
3434
const client = http2.connect(`http://localhost:${server.address().port}`);
3535
const req = client.request();
3636

@@ -49,4 +49,4 @@ server.listen(0, () => {
4949
server.close();
5050
}));
5151
req.end();
52-
});
52+
}));

0 commit comments

Comments
 (0)