Skip to content

Commit

Permalink
return plain string when an invalid clazz is given
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorik Tangelder committed Apr 6, 2016
1 parent 4d2daef commit 0411600
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/report/common/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0411600

Please # to comment.