-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 fix no colors to run command #1902
Feature fix no colors to run command #1902
Conversation
This looks good but just to be sure can you add a e2e test using the mocha reporter that checks for the correct output please? |
@dignifiedquire Yes, I'll add it this weekend. |
@budde377 thanks. Do you want to join the karma maintainer team? Main rules are, keep doing great work like you did, and don't push/merge to |
@dignifiedquire Yes, I would very much like that :) |
@budde377 done, welcome to the team |
14ae540
to
4ca7378
Compare
@dignifiedquire Here you go! |
@budde377 this needs a rebase after I merged your other PR |
4ca7378
to
73b7cdf
Compare
@dignifiedquire, Here you go ;) |
Thanks. Here goes nothing |
Damn. There is another conflict sorry |
Add colors and log-level arguments to run argument. Refactor log-setup functions for server and init. Correct bug in server where log-level was ignored before `parseConfig` Closing karma-runner#1067
Delay the decision on color/no-color reporter to write. This is done by letting the individual adapter decide the color and providing a default color to the base adapter. Closing karma-runner#1067
Fix problems: * Not relying on Reporter.USE_COLORS property * Construct factory with right configuration
When loading a reporter, look for a color-version of this.
Add a test of the karma-mocha-reporter. Testing that it outputs correctly.
73b7cdf
to
76cdd60
Compare
No prop. This should do the trick. |
…ommand Feature fix no colors to run command
I have not identified and fixed the problem with the 3rd-party reporters not working. The problem was that the reporters didn't update the
USE_COLORS
property, from its default value:false
. The feature relies highly on this property to be updated and when it wasn't, the reporter would be interpreted as a no-color reporter.In-order not to break backwards compatibility, a new property was introduced:
EXCLUSIVELY_USE_COLORS
withundefined
as it's default value. By using this property, the no-colours feature (in the run command) will work for default reporters, i.e. dots and process, and reporters choosing to update the property.When fixing this, it became obvious why 3rd-party reporters didn't wan't to update this property: They didn't want to implement two reporters, because this would require for their users to add two reporters to their configuration.
For instance; for the mocha reporter, used in #1894, to implement this feature they would first implement two reporters, say
reporter:mocha
andreporter:mocha_color
, which would yield a configuration as:where omitting one would disable reporting w/w.o colours, depending on the omitted reporter.
I fixed this in 3294a15 by attempting (silently) to load a "coloured" version of a given reporter. Thus for the mocha reporter to support this feature, all they need to do is implement and export two reporters:
reporter:mocha
andreporter:mocha_color
. The user-configurations would remain unchanged: I.e.Given a reporter with name
foo
the coloured version must be namedfoo_color
, i.e. with postfix_color
.