Skip to content

Commit

Permalink
reverts usage of chalk and all chalk-related changes thereafter; closes
Browse files Browse the repository at this point in the history
  • Loading branch information
boneskull committed Jan 28, 2016
1 parent 0d1bb21 commit e1bf728
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 207 deletions.
37 changes: 0 additions & 37 deletions lib/browser/chalk.js

This file was deleted.

42 changes: 20 additions & 22 deletions lib/reporters/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ var diff = require('diff');
var ms = require('../ms');
var utils = require('../utils');
var supportsColor = process.browser ? null : require('supports-color');
var chalk = require('chalk');
chalk.enabled = supportsColor;

/**
* Expose `Base`.
Expand Down Expand Up @@ -52,25 +50,25 @@ exports.inlineDiffs = false;
*/

exports.colors = {
pass: chalk.gray,
fail: chalk.red,
'bright pass': chalk.green.bold,
'bright fail': chalk.red.bold,
'bright yellow': chalk.yellow.bold,
pending: chalk.cyan,
suite: chalk.white,
'error title': chalk.gray,
'error message': chalk.red,
'error stack': chalk.white,
checkmark: chalk.green,
fast: chalk.gray,
medium: chalk.yellow,
slow: chalk.red,
green: chalk.green,
light: chalk.white.bold,
'diff gutter': chalk.gray,
'diff added': chalk.green,
'diff removed': chalk.red
pass: 90,
fail: 31,
'bright pass': 92,
'bright fail': 91,
'bright yellow': 93,
pending: 36,
suite: 0,
'error title': 0,
'error message': 31,
'error stack': 90,
checkmark: 32,
fast: 90,
medium: 33,
slow: 31,
green: 32,
light: 90,
'diff gutter': 90,
'diff added': 32,
'diff removed': 31
};

/**
Expand Down Expand Up @@ -105,7 +103,7 @@ var color = exports.color = function(type, str) {
if (!exports.useColors) {
return String(str);
}
return exports.colors[type](str);
return '\u001b[' + exports.colors[type] + 'm' + str + '\u001b[0m';
};

/**
Expand Down
7 changes: 3 additions & 4 deletions lib/reporters/landing.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var Base = require('./base');
var inherits = require('../utils').inherits;
var cursor = Base.cursor;
var color = Base.color;
var chalk = require('chalk');

/**
* Expose `Landing`.
Expand All @@ -18,19 +17,19 @@ exports = module.exports = Landing;
* Airplane color.
*/

Base.colors.plane = chalk.white;
Base.colors.plane = 0;

/**
* Airplane crash color.
*/

Base.colors['plane crash'] = chalk.red;
Base.colors['plane crash'] = 31;

/**
* Runway color.
*/

Base.colors.runway = chalk.gray;
Base.colors.runway = 90;

/**
* Initialize a new `Landing` reporter.
Expand Down
3 changes: 1 addition & 2 deletions lib/reporters/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var Base = require('./base');
var inherits = require('../utils').inherits;
var color = Base.color;
var cursor = Base.cursor;
var chalk = require('chalk');

/**
* Expose `Progress`.
Expand All @@ -18,7 +17,7 @@ exports = module.exports = Progress;
* General progress bar color.
*/

Base.colors.progress = chalk.gray;
Base.colors.progress = 90;

/**
* Initialize a new `Progress` bar test reporter.
Expand Down

0 comments on commit e1bf728

Please sign in to comment.