Open
Description
Feature Request Checklist
- I have read and agree to Mocha's Code of Conduct and Contributing Guidelines
- I have searched for related issues and issues with the
faq
label, but none matched my issue. - I want to provide a PR to resolve this
Overview
Related to #3531 and #5385, I'd like to be able to turn off that regex/shortening. I'm assuming some people want the short form, so it needs to be an option rather than just removed.
Suggested Solution
Add a toggle around here.
Alternatives
More specific custom messages.
Additional Info
Test case:
describe('reporter', function () {
it('should log', function () {
const resultCount = 0
expect(resultCount, 'Result count').to.be.greaterThan(0)
})
})
Output:
1) reporter
should log:
Result count
+ expected - actual
at Context.<anonymous> (...)
Desired output:
1) reporter
should log:
AssertionError: Result count: expected +0 to be above +0
+ expected - actual
at Context.<anonymous> (...)
I do not want to add e message with the expectation:
- That can get out of sync if you update the expectations
- It's more to change when copying between tests
- It still does not show you the actual value unless you add that to your message too