test: check custom inspection truncation in assert#28234
test: check custom inspection truncation in assert#28234Trott wants to merge 1 commit intonodejs:masterfrom
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 |
BridgeAR
left a comment
There was a problem hiding this comment.
LGTM. Thanks for writing the tests for this!
test/parallel/test-assert.js
Outdated
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_ERRORwith a long line is inspected, the value inactualorexpectedwill 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