FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: refactor the code in test-http-connect by edsadr · Pull Request #10397 · nodejs/node · GitHub

/ node Public

test: refactor the code in test-http-connect - #10397

Closed
edsadr wants to merge 1 commit into
nodejs:masterfrom
edsadr:test-http-connect
Closed

test: refactor the code in test-http-connect#10397
edsadr wants to merge 1 commit into
nodejs:masterfrom
edsadr:test-http-connect

Conversation

edsadr commented Dec 21, 2016

Copy link
Copy Markdown
Contributor
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

Description of change
  • use common.mustCall to control the functions execution automatically
  • use let and const instead of var
  • use assert.strictEqual instead of assert.equal
  • use assert.strictEqual instead of assert.ok
  • use arrow functions

nodejs-github-bot added test Issues and PRs related to the tests. lts-watch-v6.x labels Dec 21, 2016
Comment thread test/parallel/test-http-connect.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I would avoid adding common.mustCall() to the data handler. The number of events emitted can potentially be different, and it isn't really needed for the test.

Comment thread test/parallel/test-http-connect.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Same comment here.

Comment thread test/parallel/test-http-connect.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

By using common.mustCall(), I think these variables can be eliminated completely, as can this exit event handler.

mscdex added the http Issues or PRs related to the http subsystem. label Dec 21, 2016

edsadr commented Dec 22, 2016

Copy link
Copy Markdown
Contributor Author

@cjihrig , just implemented your suggestions

Copy link
Copy Markdown

Comment thread test/parallel/test-http-connect.js Outdated

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nit: can't this be removed now? I mean the clientRequestClosed flag.

edsadr commented Dec 26, 2016

Copy link
Copy Markdown
Contributor Author

@lpinca removed as suggested, please set the CI again

lpinca commented Dec 26, 2016

Copy link
Copy Markdown
Member

Comment thread test/parallel/test-http-connect.js Outdated

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nit: this can also probably be removed.

Comment thread test/parallel/test-http-connect.js Outdated

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Same here.

* use common.mustCall to control the functions execution automatically
* use let and const instead of var
* use assert.strictEqual instead of assert.equal
* use arrow functions
* remove console.error and unnecessary variables

edsadr commented Dec 26, 2016

Copy link
Copy Markdown
Contributor Author

@lpinca removed those too

lpinca commented Dec 30, 2016

Copy link
Copy Markdown
Member

New CI before landing: https://ci.nodejs.org/job/node-test-pull-request/5635/

lpinca commented Dec 30, 2016

Copy link
Copy Markdown
Member

Landed in 72a8488.

lpinca closed this Dec 30, 2016
lpinca pushed a commit that referenced this pull request Dec 30, 2016
* use common.mustCall to control the functions execution automatically
* use let and const instead of var
* use assert.strictEqual instead of assert.equal
* use arrow functions
* remove console.error and unnecessary variables

PR-URL: #10397
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
evanlucas pushed a commit that referenced this pull request Jan 3, 2017
* use common.mustCall to control the functions execution automatically
* use let and const instead of var
* use assert.strictEqual instead of assert.equal
* use arrow functions
* remove console.error and unnecessary variables

PR-URL: #10397
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
evanlucas pushed a commit that referenced this pull request Jan 4, 2017
* use common.mustCall to control the functions execution automatically
* use let and const instead of var
* use assert.strictEqual instead of assert.equal
* use arrow functions
* remove console.error and unnecessary variables

PR-URL: #10397
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 23, 2017
* use common.mustCall to control the functions execution automatically
* use let and const instead of var
* use assert.strictEqual instead of assert.equal
* use arrow functions
* remove console.error and unnecessary variables

PR-URL: #10397
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 24, 2017
* use common.mustCall to control the functions execution automatically
* use let and const instead of var
* use assert.strictEqual instead of assert.equal
* use arrow functions
* remove console.error and unnecessary variables

PR-URL: #10397
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
MylesBorins mentioned this pull request Jan 24, 2017
MylesBorins pushed a commit that referenced this pull request Jan 31, 2017
* use common.mustCall to control the functions execution automatically
* use let and const instead of var
* use assert.strictEqual instead of assert.equal
* use arrow functions
* remove console.error and unnecessary variables

PR-URL: #10397
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

http Issues or PRs related to the http subsystem. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants


Back | FazBrowse Home | New Git URL