Skip to content

Commit

Permalink
fix: correct isTTY logic for colorization
Browse files Browse the repository at this point in the history
  • Loading branch information
dbushong committed Aug 13, 2017
1 parent 94d2976 commit 1860ca3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/assertive.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/assertive.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/assertive.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ let green = x => `\x1B[32m${x}\x1B[39m`;
let red = x => `\x1B[31m${x}\x1B[39m`;
let clear = '\x1b[39;49;00m';

if (global.process && process.isTTY && process.isTTY()) {
if (!(global.process && process.stdout && process.stdout.isTTY)) {
red = x => `${x}`;
green = red;
clear = '';
Expand Down
2 changes: 1 addition & 1 deletion test/assertive.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ describe('deepEqual', () => {

it('diffs Actual and Expected values', () => {
const err = throws(() => deepEqual({ b: 2, a: 1 }, { b: 3, a: 1 }));
match(/"a": 1,\n.+- {3}"b": 3.+\n.+\+ {3}"b": 2/, err.message);
match(/"a": 1,\n.*- {3}"b": 3.*\n.*\+ {3}"b": 2/, err.message);
});
});

Expand Down

0 comments on commit 1860ca3

Please sign in to comment.