By passing colors: true to mocha, colors will always be used, regardless of what the current tty supports. This means you get a bunch of garbage if for example piping the test output to a file.
This change will only pass colors: true to mocha if color is supported.
By passing
colors: true
to mocha, colors will always be used, regardless of what the current tty supports. This means you get a bunch of garbage if for example piping the test output to a file.This change will only pass
colors: true
to mocha if color is supported.