Skip to content
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

[8.x] assert: revert breaking change #24786

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/assert.js
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
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
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