-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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: check custom inspection truncation in assert #28234
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
It is by design: we used to only visualize the stack property in case of a fatal exception and other cases. I changed that recently to fully inspect errors on fatal exceptions. Now all properties on an error will be fully inspected. Since the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for writing the tests for this!
test/parallel/test-assert.js
Outdated
}); | ||
|
||
// Output that extends beyond 10 lines sould also be truncated for display. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: sould
-> should
This comment has been minimized.
This comment has been minimized.
The assert module has some truncation logic in a custom inspect function. This was not covered in tests. Add tests to cover it. PR-URL: nodejs#28234 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Landed in e3d5257 |
The assert module has some truncation logic in a custom inspect function. This was not covered in tests. Add tests to cover it. PR-URL: #28234 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
The assert module has some truncation logic in a custom inspect
function. This was not covered in tests. Add tests to cover it.
The previously-uncovered lines are
node/lib/internal/assert/assertion_error.js
Lines 437 to 442 in b614840
@BridgeAR I could use some confirmation that this is covering a feature and not revealing a bug. When an
ASSERTION_ERROR
with a long line is inspected, the value inactual
orexpected
will be truncated but the same value will appear in full in themessage
. Whoops? Or by design?Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes