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-tls-check-server-identity var->const, assert, string template #9986

Closed
wants to merge 3 commits into from
Closed

test-tls-check-server-identity var->const, assert, string template #9986

wants to merge 3 commits into from

Conversation

koxauvin
Copy link
Contributor

@koxauvin koxauvin commented Dec 1, 2016

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

test

Description of change

Changed var to const, assert.equal to assert.strictEqual, and used a template string for error output.

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Dec 1, 2016
@mscdex mscdex added the tls Issues and PRs related to the tls subsystem. label Dec 1, 2016
@mscdex
Copy link
Contributor

mscdex commented Dec 1, 2016

Please see the commit message guidelines here.

@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
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.

Almost there!

assert.strictEqual(err && err.reason,
test.error,
`Test# ${i} failed: ${util.inspect(test)} \n
${test.error} != ${(err && err.reason)}`);
Copy link
Member

Choose a reason for hiding this comment

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

Please avoid multi-line template literals, especially given that the additional whitespace will be included in the string.

                     `Test# ${i} failed: ${util.inspect(test)} \n` +
                     `${test.error} != ${(err && err.reason)}`);

var assert = require('assert');
var util = require('util');
const common = require('../common');
const assert = require('assert');
Copy link
Member

Choose a reason for hiding this comment

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

please move the assert and util requires after the hasCrypto check

Copy link
Contributor Author

@koxauvin koxauvin Dec 5, 2016

Choose a reason for hiding this comment

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

I tried removing the block
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}
but module common is not used "error 'common' is assigned a value but never used no-unused-vars".
Then when I remove the require for common I get "error Mandatory module "common" must be loaded required-modules"
The util requires in used in the string template, can't remove that.

Copy link
Member

Choose a reason for hiding this comment

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

@koxauvin Please don't remove the hasCrypto check. It is needed for this test. But please move the assignments to assert and util to be after that block.

Changed var to const, assert.equal to assert.strictEqual, and
used a template string for error output.
Converted multi-line string template literals to string concatentation.
Converted multi-line string template literals to string concatentation.
@Trott
Copy link
Member

Trott commented Dec 24, 2016

@jasnell I updated @koxauvin's branch per your comments. Can you take a look and update your review if appropriate? Thanks!

@Trott
Copy link
Member

Trott commented Dec 24, 2016

@Trott
Copy link
Member

Trott commented Dec 24, 2016

Lone CI failure is a Jenkins/build issue and unrelated to the changes here.

Trott pushed a commit to Trott/io.js that referenced this pull request Dec 24, 2016
Changed var to const, assert.equal to assert.strictEqual, and
used a template string for error output.

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

Trott commented Dec 24, 2016

Landed in b00f8ad.
Thanks for the contribution! 🎉

@Trott Trott closed this Dec 24, 2016
targos pushed a commit that referenced this pull request Dec 26, 2016
Changed var to const, assert.equal to assert.strictEqual, and
used a template string for error output.

PR-URL: #9986
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Dec 27, 2016
targos pushed a commit that referenced this pull request Dec 28, 2016
Changed var to const, assert.equal to assert.strictEqual, and
used a template string for error output.

PR-URL: #9986
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
evanlucas pushed a commit that referenced this pull request Jan 3, 2017
Changed var to const, assert.equal to assert.strictEqual, and
used a template string for error output.

PR-URL: #9986
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
evanlucas pushed a commit that referenced this pull request Jan 4, 2017
Changed var to const, assert.equal to assert.strictEqual, and
used a template string for error output.

PR-URL: #9986
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 23, 2017
Changed var to const, assert.equal to assert.strictEqual, and
used a template string for error output.

PR-URL: #9986
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 24, 2017
Changed var to const, assert.equal to assert.strictEqual, and
used a template string for error output.

PR-URL: #9986
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2017
MylesBorins pushed a commit that referenced this pull request Feb 1, 2017
Changed var to const, assert.equal to assert.strictEqual, and
used a template string for error output.

PR-URL: #9986
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
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.

8 participants