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
add more friendly output for dot reporter in colorless mode #1702
Conversation
I like the suggestion, but there's no way we can merge this without breaking backwards compatibility. On the other hand, in what bizarre use-case would you use the output of the dot reporter in a script? @boneskull what do you think? I'd say merge ;-) |
I'm not sure why you are saying it breaks compatibility because now mocha with The notion behind this is get a minimal report but get it meaningfully. Like if you running the test with a build script and redirect the output into a file you have a nice little output of it. |
}); | ||
|
||
runner.on('pass', function(test){ | ||
if (++n % width == 0) process.stdout.write('\n '); | ||
if ('slow' == test.speed) { | ||
process.stdout.write(color('bright yellow', Base.symbols.dot)); | ||
process.stdout.write(color('bright yellow', Base.symbols.dot, 'S')); | ||
} else { | ||
process.stdout.write(color(test.speed, Base.symbols.dot)); |
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.
@pcdevil this one too?
@pcdevil This is a breaking change because the output of the dot reporter now differs if no TTY is present (for example). Granted, I don't expect anyone is trying to use a machine to parse the output of the |
2f458ab
to
2952eca
Compare
Handled in #2000. |
Currently when using dot reporter with
no-colors
option the dot-matrix output has no use.To resolve that I want to introduce an extra parameter to the base reporter's
color
function which is a fallback string if colors are disabled. If this parameter is given the function will return that instead of the original string.Using this parameter the dot reporter can easily signal the difference between tests and it will output the following:
P
if the test is pendingS
if the test is slowF
on failure