Skip to content

Conversation

@BridgeAR
Copy link
Member

@BridgeAR BridgeAR commented Apr 1, 2018

This makes sure all properties that are meant to be checked will
actually be tested for. Otherwise properties might be missed.

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

This makes sure all properties that are meant to be checked will
actually be tested for.
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Apr 1, 2018
@BridgeAR
Copy link
Member Author

BridgeAR commented Apr 1, 2018

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 2, 2018
@lpinca
Copy link
Member

lpinca commented Apr 4, 2018

Landed in 2fef227.

@lpinca lpinca closed this Apr 4, 2018
lpinca pushed a commit that referenced this pull request Apr 4, 2018
This makes sure all properties that are meant to be checked will
actually be tested for.

PR-URL: #19722
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
@joyeecheung
Copy link
Member

Is it intentional that code will be checked after message? Right now if an error with a wrong code is thrown, one will have to search for the message formatter with the message in lib/internal/errors.js in order to understand what code the actual error has.

@joyeecheung
Copy link
Member

cc @BridgeAR ^

@targos targos added backport-requested-v9.x and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Apr 4, 2018
@targos
Copy link
Member

targos commented Apr 4, 2018

This commit lands cleanly on v9.x-staging but tests don't pass. Should it be backported?

@BridgeAR
Copy link
Member Author

BridgeAR commented Apr 4, 2018

I guess in that case it would be best to backport it to make sure all properties are actually properly tested.

@BridgeAR
Copy link
Member Author

BridgeAR commented Apr 4, 2018

@joyeecheung sorry, I overlooked your comment.

It was not intentional to move the code check after message. That is actually now depending on the insertion order of the properties that should be checked. I actually recommend not to use common.expectsError in case it is not needed (in all cases when it is not used as callback). If assert.throws is used instead, all properties are going to be compared. That makes debugging much easier.

Since this function is still used currently, I am going to open another PR to add a similar functionality to common.expectsError. That way the order is not important anymore.

BridgeAR added a commit to BridgeAR/node that referenced this pull request May 1, 2018
This makes sure all properties that are meant to be checked will
actually be tested for.

PR-URL: nodejs#19722
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
@BridgeAR BridgeAR deleted the check-all-properties branch April 1, 2019 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants