-
-
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
New --unified-diff flag makes expected/actual easier to read without colors #862
Conversation
…orks both with & without colour support)
+1; |
@@ -204,6 +205,10 @@ if (~process.argv.indexOf('--colors') || | |||
Base.useColors = true; | |||
} | |||
|
|||
// --unified-diff | |||
|
|||
if (~process.argv.indexOf('--unified-diff')) Base.unifiedDiff = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be if (program.unifiedDiff) <stuff>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks I didn't know about that, I'll make the change.
I almost think we should just remove the flag and make the |
Would it be the other way around, with a flag for inline diffs? Ditching the top/bottom part of the unified diff makes sense, I'll have a look at that later today. We could keep the 3 line context though, it helps knowing where the diff is. |
A few more fixes:
Maybe this could use actual unit tests - for now it's a set of "failing" assertions we need to run & check if the output looks OK. |
This is very cool. Could you could rebase to collapse some of these commits together? Especially, the last six or so. |
Thanks, all rebased! I'll look at the (lack of) unit tests later this weekend. |
cool lookin good, apparently still needs a rebase, dont worry about the squash for now I'll pull it down after and tweak a couple things and merge it over as one |
Any chance of this getting merged? |
💥 |
As suggested in this issue: #702
For example, take this test:
mocha
mocha -C
(or looking at text-only logs)mocha --unified-diff
mocha --unified-diff -C
(or looking at text-only logs)It's my first contrib to Mocha, so another pair of eyes would be helpful.
But hopefully this will make troubleshooting tests easier!