mocha icon indicating copy to clipboard operation
mocha copied to clipboard

Add indentation to error message when it has several line breaks(#2159)

Open 2kindsofcs opened this issue 6 years ago • 6 comments
trafficstars

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.

2kindsofcs avatar Aug 16 '19 12:08 2kindsofcs

CLA assistant check
All committers have signed the CLA.

jsf-clabot avatar Aug 16 '19 12:08 jsf-clabot

Coverage Status

Coverage increased (+0.08%) to 92.503% when pulling 4d446e6d55789e838a9b0103a8f90c84cc43b5ca on 2kindsofcs:issue/2159 into fafa9b98809b941e8e6ea81868eabdc22cbd17af on mochajs:master.

coveralls avatar Aug 16 '19 12:08 coveralls

@2kindsofcs Please sign CLA by clicking the CLA badge above.

outsideris avatar Aug 17 '19 02:08 outsideris

@outsideris I signed CLA jsut a minute ago. thanks.

2kindsofcs avatar Aug 17 '19 03:08 2kindsofcs

ref: https://github.com/mochajs/mocha/issues/2159

outsideris avatar Sep 17 '19 16:09 outsideris

This issue is still present. Is there any reason not to merge this?

marcbachmann avatar May 18 '21 22:05 marcbachmann

👋 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!

JoshuaKGoldberg avatar Dec 02 '23 21:12 JoshuaKGoldberg

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!

JoshuaKGoldberg avatar Mar 01 '24 16:03 JoshuaKGoldberg