Skip to content

Commit 4dd095c

Browse files
Runite618MylesBorins
authored andcommitted
test: refactor async-hooks/test-httparser tests
CRLF variable was defined but only used on line 22 so the variable was deleted and placed inside line 22 as a string literal. This was in file test-httpparser.request.js On line 46 there's a function declared that takes 3 arguments but none of them are ever used so removed. This is in file test-httpparser.response.js PR-URL: #14818 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 9589641 commit 4dd095c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

test/async-hooks/test-httpparser.request.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const { checkInvocations } = require('./hook-checks');
99
const binding = process.binding('http_parser');
1010
const HTTPParser = binding.HTTPParser;
1111

12-
const CRLF = '\r\n';
1312
const REQUEST = HTTPParser.REQUEST;
1413

1514
const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0;
@@ -19,7 +18,7 @@ const hooks = initHooks();
1918
hooks.enable();
2019

2120
const request = Buffer.from(
22-
'GET /hello HTTP/1.1' + CRLF + CRLF
21+
'GET /hello HTTP/1.1\r\n\r\n'
2322
);
2423

2524
const parser = new HTTPParser(REQUEST);

test/async-hooks/test-httpparser.response.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function onheadersComplete() {
4343
'when onheadersComplete called');
4444
}
4545

46-
function onbody(buf, start, len) {
46+
function onbody() {
4747
checkInvocations(httpparser, { init: 1, before: 2, after: 1 },
4848
'when onbody called');
4949
tick(1, common.mustCall(tick1));

0 commit comments

Comments
 (0)