Skip to content

Commit

Permalink
assert: revert breaking change
Browse files Browse the repository at this point in the history
It was not intended to change the `assert.doesNotThrow()` message
with #23223. This reverts the
breaking behavior to the one before.

PR-URL: #24786
Refs: #23223
Reviewed-By: Beth Griggs <[email protected]>
  • Loading branch information
BridgeAR authored and BethGriggs committed Dec 11, 2018
1 parent 74c1074 commit 62fb5db
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ function expectsNoError(stackStartFn, actual, error, message) {
actual,
expected: error,
operator: stackStartFn.name,
message: `Got unwanted ${fnType}${details}\n${actual.message}`,
message: `Got unwanted ${fnType}${details}`,
stackStartFn
});
}
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-assert-async.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ common.crashOnUnhandledRejection();
assert(err instanceof assert.AssertionError,
`${err.name} is not instance of AssertionError`);
assert.strictEqual(err.code, 'ERR_ASSERTION');
assert(/^Got unwanted rejection\.\n$/.test(err.message));
assert(/^Got unwanted rejection\.$/.test(err.message));
assert.strictEqual(err.operator, 'doesNotReject');
assert.ok(!err.stack.includes('at Function.doesNotReject'));
return true;
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ common.expectsError(
type: a.AssertionError,
code: 'ERR_ASSERTION',
operator: 'doesNotThrow',
message: 'Got unwanted exception: user message\n[object Object]'
message: 'Got unwanted exception: user message'
}
);

Expand Down

0 comments on commit 62fb5db

Please sign in to comment.