mocha
mocha copied to clipboard
Add indentation to error message when it has several line breaks(#2159)
At the moment mocha only indent the first line of the report message. This PR would indent all lines of the message when it has line breaks so that it would look neat. I checked out that it worked out with the example below.
describe('suite', function() {
it('test', function() {});
it('test2', function() {
throw new Error('foo\nbar\nbaz');
});
});
by the way, I ran "npm test" before creating PR and got 185 passing, 4 pending, 6 failing. but the errors seems regardless of code that I added. So I ran "npm test" again after commenting out changes I made and got the exactly same result. errlog_original.txt I was wondering if there's any other ways to check this change is safe.
Coverage increased (+0.08%) to 92.503% when pulling 4d446e6d55789e838a9b0103a8f90c84cc43b5ca on 2kindsofcs:issue/2159 into fafa9b98809b941e8e6ea81868eabdc22cbd17af on mochajs:master.
@2kindsofcs Please sign CLA by clicking the CLA badge above.
@outsideris I signed CLA jsut a minute ago. thanks.
ref: https://github.com/mochajs/mocha/issues/2159
This issue is still present. Is there any reason not to merge this?
👋 coming back to this @2kindsofcs, are you still interested in working on this PR? As of https://github.com/mochajs/mocha/issues/5027 there are again maintainers who can review it now. No worries if you no longer have time - but if you do that'd be great!
Ah, per https://github.com/mochajs/mocha/issues/2159#issuecomment-1902532531, the backing issue is not something we'd like to have implemented. Thanks for the PR though!