Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
test: refactor test/parallel/test-https-agent.js
Replaced console.log(res.statusCode); with and assertion, Rather than logging the https request status on every loop it will now assert the https status is correct on every loop.
  • Loading branch information
Williams-Dan committed Sep 15, 2016
commit a05d57ebcda0a560d7a6165fd2342efcf93ca01a
2 changes: 1 addition & 1 deletion test/parallel/test-https-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ server.listen(0, function() {
rejectUnauthorized: false
}, function(res) {
res.resume();
console.log(res.statusCode);
assert.strictEqual(res.statusCode, 200);
if (++responses === N * M) server.close();
}).on('error', function(e) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would change this to on('error', common.fail) or on('error', function(e) { throw e; }); not sure what is the preferred way, looks like both are used in other tests.

console.log(e.message);

@lpinca lpinca Sep 14, 2016

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder if it's better to throw the error here instead of logging the error message. Maybe the whole error listener can be removed, an error is thrown if there isn't one.

Expand Down