-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
🚀 Feature: Indent all lines on message #2159
Comments
Can you give an example where formatting is broken? E.g. this seems correct to me:
|
@danielstjules the issue is visible if you have a multi-line error message: describe('suite', function() {
it('test', function() {});
it('test2', function() {
throw new Error('foo\nbar\nbaz');
});
});
|
Yes, the problem is the one that @Turbo87 has described, if the error message has multiple lines they get unindented. It would be as simple as split the message on new lines and apply the indention to all of them. |
Hi there. I checked out exactly the same issue is still present(ver 6.2.0). I would like to fix this problem. |
This feels to me like something that should be behind an option. It's useful to be able to select & copy the exact characters of an error in some cases. |
Coming back to this: per #5027 we're trying not to make too many big changes, and there are already a lot of options in Mocha. This issue has received, on average, about one positive interaction every 1.5 years since it was filed. I don't think it makes the cut. If you really want this to happen, please do ask to re-open. We certainly can. But please also provide a concrete proposal for what the option would look like. 🙂 |
I think @Turbo87 already showed the actual issue... |
I mean, the option. Like, what CLI option would be added to Mocha. |
I don't think it needs an option, or if any, it should be enabled by default and an opt-out option. |
As discussed at BadgeLabs/mocha-eslint#38 (comment)
mocha
only indent the first line of the report message, making it ugly since it gets unaligned with the mocha output. I've also seen that the code to indent the message is duplicated in several of the reporters, so if you like the idea I could try to unify them and implement it myself./cc @Turbo87
The text was updated successfully, but these errors were encountered: