Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: refactor async-hooks/test-httparser tests #14818

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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