Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #306 from gustavnikolaj/feature/colorizedOutput

use supports-color module
commit bc1cbdeeacf83343955b8bf473dbd7b60cdcde10 2 parents b9fcc4e + 28599b5
@gotwarlost gotwarlost authored
Showing with 3 additions and 1 deletion.
  1. +2 −1  lib/report/common/defaults.js
  2. +1 −0  package.json
View
3  lib/report/common/defaults.js
@@ -4,6 +4,7 @@
*/
var Report = require('../index');
+var supportsColor = require('supports-color');
module.exports = {
watermarks: function () {
@@ -23,7 +24,7 @@ module.exports = {
colorize: function (str, clazz) {
/* istanbul ignore if: untestable in batch mode */
- if (process.stdout.isTTY) {
+ if (supportsColor) {
switch (clazz) {
case 'low' : str = '\033[91m' + str + '\033[0m'; break;
case 'medium': str = '\033[93m' + str + '\033[0m'; break;
View
1  package.json
@@ -70,6 +70,7 @@
"fileset": "0.1.x",
"which": "1.0.x",
"async": "0.9.x",
+ "supports-color": "1.2.x",
"abbrev": "1.0.x",
"wordwrap": "0.0.x",
"resolve": "0.7.x",
Please sign in to comment.
Something went wrong with that request. Please try again.