Skip to content

Commit

Permalink
test: refactor async-hooks/test-httparser tests
Browse files Browse the repository at this point in the history
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 <vsemozhetbyt@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Runite618 authored and MylesBorins committed Sep 10, 2017
1 parent df592b2 commit 8004625
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions test/async-hooks/test-httpparser.request.js
Expand Up @@ -9,7 +9,6 @@ const { checkInvocations } = require('./hook-checks');
const binding = process.binding('http_parser');
const HTTPParser = binding.HTTPParser;

const CRLF = '\r\n';
const REQUEST = HTTPParser.REQUEST;

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

const request = Buffer.from(
'GET /hello HTTP/1.1' + CRLF + CRLF
'GET /hello HTTP/1.1\r\n\r\n'
);

const parser = new HTTPParser(REQUEST);
Expand Down
2 changes: 1 addition & 1 deletion test/async-hooks/test-httpparser.response.js
Expand Up @@ -43,7 +43,7 @@ function onheadersComplete() {
'when onheadersComplete called');
}

function onbody(buf, start, len) {
function onbody() {
checkInvocations(httpparser, { init: 1, before: 2, after: 1 },
'when onbody called');
tick(1, common.mustCall(tick1));
Expand Down

0 comments on commit 8004625

Please sign in to comment.