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: fix assert.strictEqual() parameter order #23564

Closed
wants to merge 1 commit into from

Conversation

lotharthesavior
Copy link
Contributor

…follow the order actual-value->expected-value.

According to the documentation, the strictEqual assertions should follow the order actual-value -> expected-value. This PR is changing the current situation of the test parallel/test-tcp-wrap-connect.js to accomplish it.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

…eters follow the order actual-value->expected-value.

Refs: test/parallel/test-tcp-wrap-connect.js
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Oct 12, 2018
@addaleax addaleax added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Oct 12, 2018
@addaleax
Copy link
Member

Hi @lotharthesavior – just as a heads up, our CI does not deal well with merge commits. Do you think you could rebase this instead? Let us know if you need any help!

@lotharthesavior
Copy link
Contributor Author

Hi, @addaleax , thanks for the review, I removed the merge commit. Let me know if there is something else.

@addaleax
Copy link
Member

@lotharthesavior Thanks!

@BridgeAR BridgeAR changed the title Reordered parameters to the test-tcp-wrap-connect test: fix assert.strictEqual() parameter order Oct 12, 2018

const shutdownReq = new ShutdownWrap();
const err = client.shutdown(shutdownReq);
assert.strictEqual(err, 0);

shutdownReq.oncomplete = function(status, client_, error) {
assert.strictEqual(0, status);
assert.strictEqual(client, client_);
assert.strictEqual(error, undefined);
Copy link
Member

Choose a reason for hiding this comment

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

Should this order be preserved?

Copy link
Contributor Author

@lotharthesavior lotharthesavior Oct 12, 2018

Choose a reason for hiding this comment

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

Hi, @trivikr , would you explain further you comment? I believe that the order here is already changed, unless you meant something else. I didn't understand before, but now I got what you said. I have a question, though: why would it be preserved?

Copy link
Member

Choose a reason for hiding this comment

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

My bad, the comment was for line 34.
The strictEqual assertions should follow the order actual-value -> expected-value, where error is actual value, while undefined is expected value.

Copy link
Member

Choose a reason for hiding this comment

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

Fixed while landing.

BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Oct 15, 2018
PR-URL: nodejs#23564
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Oct 15, 2018
PR-URL: nodejs#23564
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
@BridgeAR
Copy link
Member

Landed in aee771c 🎉

@lotharthesavior congratulations on your commit to Node.js!

@BridgeAR BridgeAR closed this Oct 15, 2018
@lotharthesavior
Copy link
Contributor Author

Thanks, @BridgeAR ! I'm looking forward to contributing more!

jasnell pushed a commit that referenced this pull request Oct 17, 2018
PR-URL: #23564
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
addaleax pushed a commit that referenced this pull request Oct 20, 2018
PR-URL: #23564
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
MylesBorins pushed a commit that referenced this pull request Oct 30, 2018
PR-URL: #23564
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
@codebytere codebytere mentioned this pull request Nov 27, 2018
rvagg pushed a commit that referenced this pull request Nov 28, 2018
PR-URL: #23564
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
MylesBorins pushed a commit that referenced this pull request Nov 29, 2018
PR-URL: #23564
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
@codebytere codebytere mentioned this pull request Nov 29, 2018
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants