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 to const/let and common.mustCall #9934

Closed
wants to merge 1 commit into from
Closed

test: refactor to const/let and common.mustCall #9934

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Dec 1, 2016

test: refactor to const/let and common.mustCall

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

test

Description of change

task assigned at NINA 2016 Austin code and learn
refactor var -> const/let
refactor process.on('exit') into common.mustCall

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Dec 1, 2016
@imyller imyller added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Dec 1, 2016
@mscdex mscdex added the tls Issues and PRs related to the tls subsystem. label Dec 1, 2016
key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'),
cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem')
};

var server = tls.Server(options, function(socket) {
const server = tls.Server(options, function(socket) {
Copy link
Contributor

Choose a reason for hiding this comment

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

common.mustCall() takes an optional second argument that specifies the number of times the function should be called. You could use that here, and then completely remove the process.on('exit', ...) block.

@ghost
Copy link
Author

ghost commented Dec 4, 2016

adjusted

key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'),
cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem')
};

var server = tls.Server(options, function(socket) {
if (++serverConnected === 2) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you can drop this check. It changes the behavior. The server will be closed the first time instead of the second.

refactor var -> const/let
refactor process.on('exit') into common.mustCall
@ghost
Copy link
Author

ghost commented Dec 5, 2016

adjusted

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

LGTM pending CI.

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 pending CI (will run the CI soon, just waiting for other jobs to finish)

@jasnell
Copy link
Member

jasnell commented Dec 5, 2016

@Trott
Copy link
Member

Trott commented Dec 6, 2016

Single CI failure is unrelated.

Trott pushed a commit to Trott/io.js that referenced this pull request Dec 6, 2016
refactor var -> const/let
refactor process.on('exit') into common.mustCall

PR-URL: nodejs#9934
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@Trott
Copy link
Member

Trott commented Dec 6, 2016

Landed in d648f2b.
Thanks for the contribution! 🎉

@Trott Trott closed this Dec 6, 2016
Fishrock123 pushed a commit that referenced this pull request Dec 6, 2016
refactor var -> const/let
refactor process.on('exit') into common.mustCall

PR-URL: #9934
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax pushed a commit to addaleax/node that referenced this pull request Dec 8, 2016
refactor var -> const/let
refactor process.on('exit') into common.mustCall

PR-URL: nodejs#9934
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
jmdarling pushed a commit to jmdarling/node that referenced this pull request Dec 8, 2016
refactor var -> const/let
refactor process.on('exit') into common.mustCall

PR-URL: nodejs#9934
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 20, 2016
refactor var -> const/let
refactor process.on('exit') into common.mustCall

PR-URL: #9934
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 21, 2016
refactor var -> const/let
refactor process.on('exit') into common.mustCall

PR-URL: #9934
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 21, 2016
refactor var -> const/let
refactor process.on('exit') into common.mustCall

PR-URL: #9934
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This was referenced Dec 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. test Issues and PRs related to the tests. tls Issues and PRs related to the tls subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants