{{ message }}
assert: display better error message for assertion#15883
Closed
SgtPooki wants to merge 1 commit into
Closed
Conversation
This commit makes understanding assertion failures easier by displaying the values that failed the assertion.
Trott
approved these changes
Oct 8, 2017
Trott
left a comment
Member
There was a problem hiding this comment.
LGTM. It might be even better to remove the message entirely and use the default message from assert.strictEqual().
Member
targos
approved these changes
Oct 8, 2017
Trott
pushed a commit
to Trott/io.js
that referenced
this pull request
Oct 9, 2017
This commit makes understanding assertion failures easier by displaying the values that failed the assertion. PR-URL: nodejs#15883 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Member
|
Landed in beb2357. |
gibfahn
reviewed
Oct 9, 2017
|
|
||
| out.on('data', common.mustCall((c) => { | ||
| assert.strictEqual(c, inp._hash, 'hashes should match'); | ||
| assert.strictEqual(c, inp._hash, `Hash '${c}' equals '${inp._hash}'.`); |
Member
There was a problem hiding this comment.
This is actually not quite correct (although it was equally wrong before 😁 ). The message is displayed if the assert fails, which only happens when the two values are not equal to each other.
@SgtPooki if you could push a commit that just removes the message altogether (making it assert.strictEqual(c, inp._hash); that would be really helpful.
Contributor
Author
MylesBorins
pushed a commit
that referenced
this pull request
Oct 11, 2017
This commit makes understanding assertion failures easier by displaying the values that failed the assertion. PR-URL: #15883 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Merged
addaleax
pushed a commit
to addaleax/ayo
that referenced
this pull request
Oct 12, 2017
This commit makes understanding assertion failures easier by displaying the values that failed the assertion. PR-URL: nodejs/node#15883 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Oct 17, 2017
This commit makes understanding assertion failures easier by displaying the values that failed the assertion. PR-URL: #15883 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Merged
MylesBorins
pushed a commit
that referenced
this pull request
Oct 18, 2017
This commit makes understanding assertion failures easier by displaying the values that failed the assertion. PR-URL: #15883 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Oct 25, 2017
This commit makes understanding assertion failures easier by displaying the values that failed the assertion. PR-URL: #15883 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Merged
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.

This commit makes understanding assertion failures easier by
displaying the values that failed the assertion.
Changes the error message from
to
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)