Skip to content

Commit bd7004f

Browse files
committed
assert: revert breaking change
It was not intended to change the `assert.doesNotThrow()` message with nodejs#23223. This reverts the breaking behavior to the one before.
1 parent ffe1f80 commit bd7004f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/assert.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ function expectsNoError(stackStartFn, actual, error, message) {
782782
actual,
783783
expected: error,
784784
operator: stackStartFn.name,
785-
message: `Got unwanted ${fnType}${details}\n${actual.message}`,
785+
message: `Got unwanted ${fnType}${details}`,
786786
stackStartFn
787787
});
788788
}

test/parallel/test-assert.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ common.expectsError(
460460
type: a.AssertionError,
461461
code: 'ERR_ASSERTION',
462462
operator: 'doesNotThrow',
463-
message: 'Got unwanted exception: user message\n[object Object]'
463+
message: 'Got unwanted exception: user message'
464464
}
465465
);
466466

0 commit comments

Comments
 (0)