Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions test/parallel/test-http-agent-uninitialized-with-handle.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ socket._handle = {
ref() { },
readStart() { },
};
const req = new http.ClientRequest(`http://localhost:${common.PORT}/`);

const server = http.createServer(common.mustCall((req, res) => {
res.end();
})).listen(common.PORT, common.mustCall(() => {
})).listen(0, common.mustCall(() => {
const req = new http.ClientRequest(`http://localhost:${server.address().port}/`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: long line I guess linter is not happy :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linter probably forgives it because it contains a URL. But it should probably be wrapped.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make lint runs with no errors -- nothing to do here I guess? I know the line is 83 chars long, is it worth it move the URL string to a new line?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems okay to me


// Manually add the socket without a _handle.
agent.freeSockets[agent.getName(req)] = [socket];
// Now force the agent to use the socket and check that _handle exists before
Expand Down
5 changes: 3 additions & 2 deletions test/parallel/test-http-agent-uninitialized.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ const agent = new http.Agent({
keepAlive: true,
});
const socket = new net.Socket();
const req = new http.ClientRequest(`http://localhost:${common.PORT}/`);

const server = http.createServer(common.mustCall((req, res) => {
res.end();
})).listen(common.PORT, common.mustCall(() => {
})).listen(0, common.mustCall(() => {
const req = new http.ClientRequest(`http://localhost:${server.address().port}/`);

// Manually add the socket without a _handle.
agent.freeSockets[agent.getName(req)] = [socket];
// Now force the agent to use the socket and check that _handle exists before
Expand Down