diff --git a/lib/report/common/defaults.js b/lib/report/common/defaults.js index fae736fe..a9851c32 100644 --- a/lib/report/common/defaults.js +++ b/lib/report/common/defaults.js @@ -24,12 +24,13 @@ module.exports = { colorize: function (str, clazz) { /* istanbul ignore if: untestable in batch mode */ - if (supportsColor) { - var colors = { - low: '31;1', - medium: '33;1', - high: '32;1' - }; + var colors = { + low: '31;1', + medium: '33;1', + high: '32;1' + }; + + if (supportsColor && colors[clazz]) { return '\u001b[' + colors[clazz] + 'm' + str + '\u001b[0m'; } return str;