Skip to content

Add colors to pretty formatter #71

Closed
wants to merge 1 commit into from

4 participants

@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
Cucumber 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
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.

@jbpros jbpros and 1 other commented on an outdated diff Jul 10, 2012
lib/cucumber/listener/formatter.js
return self;
};
+Formatter.FAILED_COLOR = "red";
+Formatter.SUCCESSFUL_COLOR = "green";
+Formatter.PENDING_COLOR = "yellow";
+Formatter.UNDEFINED_COLOR = "cyan";
+Formatter.SKIPPED_COLOR = "blue";
@jbpros
Cucumber member
jbpros added a note Jul 10, 2012

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

@renier
renier added a note Jul 10, 2012

Heh, ok. Doing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jbpros jbpros referenced this pull request Oct 3, 2012
Closed

Output in color #92

@atrniv
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
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
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
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
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
Cucumber 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.