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: Refactors variables to ES6 compatible and newer assertions #10023

Closed
wants to merge 3 commits into from

Conversation

shri3k
Copy link
Contributor

@shri3k shri3k commented Dec 1, 2016

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

test

Description of change
  • Changes var to either const or let where applicable
  • Changes assert.equal to assert.strictEqual for more "strict" check

Note:- even though ticket was asking to change process.on('exit') handler to common.mustCall - this was omitted as this kept breaking the test (my guess and from discussion with others was that it's because common.mustCall has process.on('exit') internally which never fires process.on('exit') in the test

- changes var to const/let
- changes assert.equal to assert.strictEqual

**Note: `process.on('exit')` wasn't able to change the handler to
`common.mustCall` because `common.mustCall` actually uses
`process.on('exit')` internally**
- changes var to const/let
- change assert.equal to assert.strictEqual

**Note: `process.on('exit')` wasn't able to change the handler to
`common.mustCall` because `common.mustCall` actually uses
`process.on('exit')` internally**
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Dec 1, 2016
@imyller imyller added code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. tls Issues and PRs related to the tls subsystem. labels Dec 1, 2016
assert.notEqual(serverLog[i], serverLog[i + 1]);
assert.equal(ticketLog[i], ticketLog[i + 1]);
assert.strictEqual(ticketLog[i], ticketLog[i + 1]);

// 2nd connection should have different ticket
assert.notEqual(ticketLog[i], ticketLog[i + naturalServers.length]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't this also use assert.notStrictEqual()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I'll go ahead and make changes tonight. I was initially just checking for strictEqual.

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, but there are probably other improvements that could be made.

@jasnell
Copy link
Member

jasnell commented Dec 6, 2016

- changes `notEqual` to `notStrictEqual`
@shri3k
Copy link
Contributor Author

shri3k commented Dec 7, 2016

@cjihrig went ahead and made the changes. Ready to be reviewed again.

Copy link
Member

@Trott Trott 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
Copy link
Member

Trott commented Dec 7, 2016

@mcollina
Copy link
Member

mcollina commented Dec 7, 2016

Merging now

@mcollina
Copy link
Member

mcollina commented Dec 7, 2016

Landed in 0c4c225.

@mcollina mcollina closed this Dec 7, 2016
mcollina pushed a commit that referenced this pull request Dec 7, 2016
- changes var to const/let
- changes assert.equal to assert.strictEqual
- changes `notEqual` to `notStrictEqual`

PR-URL: #10023
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
addaleax pushed a commit that referenced this pull request Dec 8, 2016
- changes var to const/let
- changes assert.equal to assert.strictEqual
- changes `notEqual` to `notStrictEqual`

PR-URL: #10023
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
addaleax pushed a commit to addaleax/node that referenced this pull request Dec 8, 2016
- changes var to const/let
- changes assert.equal to assert.strictEqual
- changes `notEqual` to `notStrictEqual`

PR-URL: nodejs#10023
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@italoacasas italoacasas mentioned this pull request Dec 15, 2016
MylesBorins pushed a commit that referenced this pull request Dec 20, 2016
- changes var to const/let
- changes assert.equal to assert.strictEqual
- changes `notEqual` to `notStrictEqual`

PR-URL: #10023
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 21, 2016
- changes var to const/let
- changes assert.equal to assert.strictEqual
- changes `notEqual` to `notStrictEqual`

PR-URL: #10023
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 21, 2016
- changes var to const/let
- changes assert.equal to assert.strictEqual
- changes `notEqual` to `notStrictEqual`

PR-URL: #10023
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@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.

None yet

9 participants