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

https: made some improvements to test-https-agent.js #8517

Closed

Conversation

Williams-Dan
Copy link
Contributor

Checklist
  • [ x] make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • [x ] commit message follows commit guidelines
Affected core subsystem(s)

https test

Description of change

This is my first good contribution, on line 40 replaced '==' with '===' for a strict compare, on line 52 I replaces 'assert.equal' with 'assert.strictEqual' again for a strict compare.

Added some comments to make it clear what the test is doing and changed 'var' to 'const' where possible.

Also added .idea to the gitignore file

This is my first good contribution, on line 40 replaced '==' with '===' for a strict compare, on line 52 I replaces 'assert.equal' with 'assert.strictEqual' again for a strict compare.

Added some comments to make it clear what the test is doing and changed 'var' to 'const' where possible.
@nodejs-github-bot nodejs-github-bot added the meta Issues and PRs related to the general management of the project. label Sep 13, 2016
@lpinca lpinca added test Issues and PRs related to the tests. https Issues or PRs related to the https subsystem. and removed meta Issues and PRs related to the general management of the project. labels Sep 13, 2016
@@ -45,6 +45,7 @@ ipch/
*.VC.opendb
.vs/
.vscode/
.idea/
Copy link
Member

Choose a reason for hiding this comment

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

Please don't change .gitignore. There is another PR specifically for this and it is still being discussed.

Copy link
Member

Choose a reason for hiding this comment

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

If you need .idea/ in your .gitignore, consider adding it to a personal global .gitignore file instead. https://help.github.com/articles/ignoring-files/#create-a-global-gitignore

@Trott
Copy link
Member

Trott commented Sep 13, 2016

Nit: Keep the first line of the commit message to under 50 chars. I would suggest this:

test: refactor test/parallel/test-https-agent.js

@Trott
Copy link
Member

Trott commented Sep 13, 2016

Aside from @lpinca's comments and barring anything discovered in CI, the changes look good to me.

CI: https://ci.nodejs.org/job/node-test-pull-request/4035/

@cjihrig
Copy link
Contributor

cjihrig commented Sep 13, 2016

LGTM once the comments are addressed.

Removed redundant comments, and removed .idea from gitignore
@Trott
Copy link
Member

Trott commented Sep 14, 2016

LGTM

@@ -37,7 +38,7 @@ server.listen(0, function() {
}, function(res) {
res.resume();
console.log(res.statusCode);
Copy link
Member

Choose a reason for hiding this comment

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

What about replacing this line with assert.strictEqual(res.statusCode, 200);?

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.
@yorkie
Copy link
Contributor

yorkie commented Sep 15, 2016

This is my first good contribution, on line 40 replaced '==' with '===' for a strict compare, on line 52 I replaces 'assert.equal' with 'assert.strictEqual' again for a strict compare.

Hey, should we label this as "good first contribution"?

console.log(res.statusCode);
if (++responses == N * M) server.close();
assert.strictEqual(res.statusCode, 200);
if (++responses === N * M) server.close();
}).on('error', function(e) {
Copy link
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.

@lpinca
Copy link
Member

lpinca commented Sep 15, 2016

Left one last comment, then I think we are ready to go.

@lpinca
Copy link
Member

lpinca commented Sep 15, 2016

@yorkie is that label used for PRs? I though it was for issues only.

@yorkie
Copy link
Contributor

yorkie commented Sep 15, 2016

@lpinca I dunno too, never mind :)

Changed the error listener to throw the error rather than log it.
Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@lpinca lpinca left a comment

Choose a reason for hiding this comment

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

LGTM

Trott pushed a commit to Trott/io.js that referenced this pull request Sep 16, 2016
On line 40: replace '==' with '==='

On line 52: replace 'assert.equal' with 'assert.strictEqual'

Added some comments.

Changed 'var' to 'const' where possible.

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.

Changed the error listener to throw the error rather than log it.

PR-URL: nodejs#8517
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@Trott
Copy link
Member

Trott commented Sep 16, 2016

Landed in a89c23f

@Trott Trott closed this Sep 16, 2016
MylesBorins pushed a commit that referenced this pull request Oct 6, 2016
On line 40: replace '==' with '==='

On line 52: replace 'assert.equal' with 'assert.strictEqual'

Added some comments.

Changed 'var' to 'const' where possible.

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.

Changed the error listener to throw the error rather than log it.

PR-URL: #8517
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
MylesBorins pushed a commit that referenced this pull request Oct 10, 2016
On line 40: replace '==' with '==='

On line 52: replace 'assert.equal' with 'assert.strictEqual'

Added some comments.

Changed 'var' to 'const' where possible.

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.

Changed the error listener to throw the error rather than log it.

PR-URL: #8517
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Fishrock123 pushed a commit that referenced this pull request Oct 11, 2016
On line 40: replace '==' with '==='

On line 52: replace 'assert.equal' with 'assert.strictEqual'

Added some comments.

Changed 'var' to 'const' where possible.

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.

Changed the error listener to throw the error rather than log it.

PR-URL: #8517
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
rvagg pushed a commit that referenced this pull request Oct 18, 2016
On line 40: replace '==' with '==='

On line 52: replace 'assert.equal' with 'assert.strictEqual'

Added some comments.

Changed 'var' to 'const' where possible.

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.

Changed the error listener to throw the error rather than log it.

PR-URL: #8517
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
MylesBorins pushed a commit that referenced this pull request Oct 26, 2016
On line 40: replace '==' with '==='

On line 52: replace 'assert.equal' with 'assert.strictEqual'

Added some comments.

Changed 'var' to 'const' where possible.

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.

Changed the error listener to throw the error rather than log it.

PR-URL: #8517
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Oct 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
https Issues or PRs related to the https subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants