Skip to content
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

Nyan Reporter ignores useColors #1461

Closed
shellscape opened this issue Dec 5, 2014 · 6 comments
Closed

Nyan Reporter ignores useColors #1461

shellscape opened this issue Dec 5, 2014 · 6 comments
Labels
type: bug a defect, confirmed by a maintainer

Comments

@shellscape
Copy link

Just what the title says. Nyan reporter is (understandably) doing a lot with colors. Unfortunately it ignores the useColors configuration altogether and outputs directly to process.stdout. From looking at the code, I understand it may be complex to honor that setting. The rest of the output from mocha honors that setting, it's just the reporter that doesn't.

Running a stripcolors function on the output before process.stdout.write in the write method might be an acceptable solution for a configuration that's probably not used very often.

@dasilvacontin
Copy link
Contributor

I think it can easily be solved by modifying both NyanCat.prototype.rainbowify and NyanCat.prototype.drawScoreboard.

@boneskull boneskull added type: bug a defect, confirmed by a maintainer status: accepting prs Mocha can use your help with this one! labels Dec 11, 2014
@dasilvacontin
Copy link
Contributor

Nasty thing, Mocha.prototype.useColors is defaulting to true when no preference is given, overwriting later the default value in Base.useColors, that was smartly checking if the terminal is a tty.

@dasilvacontin
Copy link
Contributor

What I mentioned is related to #1452.

@dasilvacontin
Copy link
Contributor

See PR #1469.

@shellscape
Copy link
Author

thank you for the work on this one @dasilvacontin

@dasilvacontin
Copy link
Contributor

You're welcome, @shellscape!

travisjeffery pushed a commit that referenced this issue Dec 15, 2014
fixes #1461: nyan-reporter now respects Base.useColors, fixed bug in Base.color
@boneskull boneskull removed the status: accepting prs Mocha can use your help with this one! label Oct 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug a defect, confirmed by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants