Skip to content

Commit

Permalink
Add option to disable colors #4
Browse files Browse the repository at this point in the history
  • Loading branch information
bcaudan committed Jun 9, 2014
1 parent c2f3eea commit 64d218c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Console spec reporter for jasmine behavior-driven development testing framework.
}

Colors are displayed in the console via [colors](https://github.com/Marak/colors.js), you can see all available colors on the [project page](https://github.com/Marak/colors.js).
You can also disable colors with the option: `colors: false`.

## Protractor
The `jasmine-spec-reporter` can be used to enhance your [Protractor](https://github.com/angular/protractor) tests execution report.
Expand Down
4 changes: 4 additions & 0 deletions src/jasmine-spec-reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ var SpecDisplay = function (options) {
this.displayFailedSpec = options.displayFailedSpec !== false;
this.displaySkippedSpec = options.displaySkippedSpec || false;
this.displaySpecDuration = options.displaySpecDuration || false;
this.displayWithoutColors = options.colors === false;

colors.setTheme({
success: options.colors && options.colors.success ? options.colors.success : 'green',
Expand Down Expand Up @@ -155,6 +156,9 @@ SpecDisplay.prototype = {
},

log: function (stuff) {
if (this.displayWithoutColors) {
stuff = stuff.stripColors;
}
console.log(this.currentIndent + stuff);
this.lastWasNewLine = false;
},
Expand Down

0 comments on commit 64d218c

Please sign in to comment.