Skip to content

assert: improve loose assertion message - #22155

Closed
BridgeAR wants to merge 1 commit into
nodejs:masterfrom
BridgeAR:improve-loose-assert-message
Closed

assert: improve loose assertion message#22155
BridgeAR wants to merge 1 commit into
nodejs:masterfrom
BridgeAR:improve-loose-assert-message

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

So far the error message from a loose assertion is not always very
informative and could be misleading. This is fixed by:

  • showing more from the actual error message
  • having a better error description
  • not using custom inspection
  • inspecting a higher depth
  • inspecting the full array instead of up to 100 entries
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

So far the error message from a loose assertion is not always very
informative and could be misleading. This is fixed by:
* showing more from the actual error message
* having a better error description
* not using custom inspection
* inspecting a higher depth
* inspecting the full array instead of up to 100 entries
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-botnodejs-github-bot added the assert Issues and PRs related to the assert subsystem. label Aug 6, 2018
@BridgeAR

Copy link
Copy Markdown
MemberAuthor

@mcollina

Copy link
Copy Markdown
Member

Code LGTM. But isn't assert.deepEqual deprecated?https://nodejs.org/api/assert.html#assert_assert_deepequal_actual_expected_message

Is this something we need?

@BridgeAR

Copy link
Copy Markdown
MemberAuthor

@mcollina it is doc deprecated but the problem is that it is still used relatively often. It is also not likely or currently intended to change the doc deprecation to a runtime deprecation. This is mainly a hot fix for some of the issues that the old version has for the case that people still use that.

@mcollinamcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@BridgeARBridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 9, 2018
BridgeAR added a commit to BridgeAR/node that referenced this pull request Aug 9, 2018
So far the error message from a loose assertion is not always very
informative and could be misleading. This is fixed by:
* showing more from the actual error message
* having a better error description
* not using custom inspection
* inspecting a higher depth
* inspecting the full array instead of up to 100 entries
PR-URL: nodejs#22155
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@BridgeAR

Copy link
Copy Markdown
MemberAuthor

Landed in 1d859ef

@rvagg

Copy link
Copy Markdown
Member

@BridgeAR if this isn't semver-major (is it?) would you mind backporting to v10.x-staging please? There's a bit too much churn in there for this to apply nicely.

@targostargos removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 19, 2018
@targos

Copy link
Copy Markdown
Member

Ping @BridgeAR

1 similar comment
@targos

Copy link
Copy Markdown
Member

Ping @BridgeAR

@targos

Copy link
Copy Markdown
Member

Ping

oyyd pushed a commit to oyyd/node that referenced this pull request Sep 25, 2018
So far the error message from a loose assertion is not always very
informative and could be misleading. This is fixed by:
* showing more from the actual error message
* having a better error description
* not using custom inspection
* inspecting a higher depth
* inspecting the full array instead of up to 100 entries
PR-URL: nodejs#22155
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@oyydoyyd mentioned this pull request Sep 26, 2018
2 tasks
@BridgeAR

Copy link
Copy Markdown
MemberAuthor

This relies on a semver-major change and should not be backported.

@BridgeAR
BridgeAR deleted the improve-loose-assert-message branch January 20, 2020 11:34
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

assertIssues and PRs related to the assert subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@BridgeAR@nodejs-github-bot@mcollina@rvagg@targos@jasnell