Closed
Conversation
These tests tested internal functionality in a way that bypassed all code that could reach these cases. Testing code like this code to be covered even though it might actually never be reached from anywhere if public APIs are used. It gives a false feeling of safety that some code works as intended while there is no guarantee that it indeed works as it should. Therefore it seemed best to remove all of these. The only thing that should be tested is the raw functionality of the internal errors.
This encapsulates the Node.js errors more by adding extra properties to an error inside of the function to create the error message instead of adding the properties at the call site. That simplifies the usage of our errors and makes sure the expected properties are always set.
e6dee93 to
c91023c
Compare
Member
Author
mcollina
reviewed
Mar 20, 2019
| if (context.dest !== undefined) | ||
| message += ` => ${context.dest}`; | ||
|
|
||
| super(message); |
Member
There was a problem hiding this comment.
Why this change? I'd prefer to have it there.
Member
Author
There was a problem hiding this comment.
I prefer it that way as well. The problem is that you may not use this before calling super() and we need the context to be able to attach properties to the error from within the function that constructs the error message.
mcollina
reviewed
Mar 20, 2019
Member
Author
jasnell
approved these changes
Mar 21, 2019
BridgeAR
added a commit
to BridgeAR/node
that referenced
this pull request
Mar 21, 2019
These tests tested internal functionality in a way that bypassed all code that could reach these cases. It gives a false feeling of safety that some code works as intended while there is no guarantee that it indeed works as it should. Therefore it seemed best to remove all of these. The only thing that should be tested is the raw functionality of the internal errors. PR-URL: nodejs#26752 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR
added a commit
to BridgeAR/node
that referenced
this pull request
Mar 21, 2019
This encapsulates the Node.js errors more by adding extra properties to an error inside of the function to create the error message instead of adding the properties at the call site. That simplifies the usage of our errors and makes sure the expected properties are always set. PR-URL: nodejs#26752 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Member
Author
targos
pushed a commit
to targos/node
that referenced
this pull request
Mar 27, 2019
These tests tested internal functionality in a way that bypassed all code that could reach these cases. It gives a false feeling of safety that some code works as intended while there is no guarantee that it indeed works as it should. Therefore it seemed best to remove all of these. The only thing that should be tested is the raw functionality of the internal errors. PR-URL: nodejs#26752 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
to targos/node
that referenced
this pull request
Mar 27, 2019
This encapsulates the Node.js errors more by adding extra properties to an error inside of the function to create the error message instead of adding the properties at the call site. That simplifies the usage of our errors and makes sure the expected properties are always set. PR-URL: nodejs#26752 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Mar 27, 2019
These tests tested internal functionality in a way that bypassed all code that could reach these cases. It gives a false feeling of safety that some code works as intended while there is no guarantee that it indeed works as it should. Therefore it seemed best to remove all of these. The only thing that should be tested is the raw functionality of the internal errors. PR-URL: #26752 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Mar 27, 2019
This encapsulates the Node.js errors more by adding extra properties to an error inside of the function to create the error message instead of adding the properties at the call site. That simplifies the usage of our errors and makes sure the expected properties are always set. PR-URL: #26752 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please have a look at the commit messages for a proper description.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes