Skip to content

Commit

Permalink
fix: make suite header coloring dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Dec 13, 2017
1 parent e6343a2 commit 4167bf2
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/LineWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@ const REG_DIFFERENCE = /^\s*Difference:/;
const MDASH = '\u2014';
const CIRCLE = '●';

const FAIL_TEXT = 'FAIL';
const PASS_TEXT = 'PASS';

const FAIL = chalk.supportsColor ?
chalk`{reset.inverse.bold.red ${FAIL_TEXT} }` :
` ${FAIL_TEXT} `;

const PASS = chalk.supportsColor ?
chalk`{reset.inverse.bold.green ${PASS_TEXT} }` :
` ${PASS_TEXT} `;

class LineWriter {
constructor (logger, root) {
this.counter = 0;
Expand Down Expand Up @@ -298,7 +287,7 @@ class LineWriter {
}

suite (isFail, dir, base) {
const label = isFail ? FAIL : PASS;
const label = isFail ? chalk`{reset.inverse.bold.red FAIL }` : chalk`{reset.inverse.bold.green PASS }`;

this.comment(chalk`${label} {grey ${this.getPathRelativeToRoot(dir)}${path.sep}}{bold ${base}}`);
}
Expand Down

0 comments on commit 4167bf2

Please sign in to comment.