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

Add colors to pretty formatter #71

Closed
wants to merge 1 commit into from

Conversation

renier
Copy link

@renier renier commented Jun 22, 2012

Add colors to pretty formatter and summarizer (optional), using the commonjs-ansi-color dependency.

@jbpros This still needs tests, but sending your way to see if you have comments on the approach first. Current tests pass.

  • Added color constants to Formatter. Not sure if they belong there, but using them from Summarizer, so needed a common place between that and PrettyFormatter.
  • Added colorizer function to Formatter, too.
  • See Summarizer for a private adorn() function. Could also be put in a common place.

@jbpros
Copy link
Member

jbpros commented Jun 22, 2012

Thank you very much, I had a quick look at the pull request, it seems good! I will review it properly over the weekend or so.

I just moved the developer-related documentation from the README to CONTRIBUTE. I had one little remark regarding the naming conventions on your contribution; instead of losing it after the pull request, I decided to list it as part of the coding guidelines. Here it is. I hope you don't mind the fact I'm reusing your code there.

@renier
Copy link
Author

renier commented Jun 22, 2012

@jbpros That's good. Don't be afraid to call out contributors on things that don't align with your vision.

Formatter.SUCCESSFUL_COLOR = "green";
Formatter.PENDING_COLOR = "yellow";
Formatter.UNDEFINED_COLOR = "cyan";
Formatter.SKIPPED_COLOR = "blue";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huge issue here: pending and undefined should be yellow; skipped should be cyan. ;)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, ok. Doing that.

@jbpros jbpros mentioned this pull request Oct 3, 2012
@atrniv
Copy link
Contributor

atrniv commented Dec 10, 2012

Why was this never added to the master branch ?
Using cucumber-js on the console without formatted output for bdd is really very frustrating.
So I ended up reimplementing this here because I found it incomplete.
I've added all the default color formats from cucumber ruby for all the formatters and also added line number displays to the output.

@Foo42
Copy link

Foo42 commented Apr 18, 2013

Is this feature implemented? I'm not seeing any colours in either pretty or standard formatted output. In fact, I'm not seeing any indication, colour or otherwise, or which features / steps are not passing. I just see a summary that one of my features is pending, but unless I'm missing something there is no way to see which.

If it's relevant, I'm using linux and running tests as an npm test script

@atrniv
Copy link
Contributor

atrniv commented Apr 18, 2013

@Foo42 the color output feature has not been merged into the master branch yet.

If you want colors you can checkout the color branch on this repo,
or use my fork which has a few more minor recent updates at https://github.com/atrniv/cucumber-js

@Foo42
Copy link

Foo42 commented Apr 18, 2013

I should clarify that I do see output for failing features, just not which are pending it seems.

@atrniv I don't suppose there's a way to get either the color branch or your fork via npm is there?

@atrniv
Copy link
Contributor

atrniv commented Apr 18, 2013

@Foo42 , yes you can ! npm is awesome that way :), just add the line below to your package.json

"cucumber-js": "git://github.com/atrniv/cucumber-js.git"

or if you want to use the main repo itself then you can just point it to the last commit on the colors branch with this line.

"cucumber-js": "git://github.com/cucumber/cucumber-js.git#0a62aea"

@jbpros
Copy link
Member

jbpros commented Jun 11, 2013

Closing this as we're working on colors based on PR #104.

@jbpros jbpros closed this Jun 11, 2013
@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants