Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Set MOCHA_COLORS env var to use colors (fix #965)

Travis Jefferyc180452dcbf3
diff --git a/lib/reporters/base.js b/lib/reporters/base.js
index 18088558..b21fefa2 100644
--- a/lib/reporters/base.js
+++ b/lib/reporters/base.js
@@ -33,7 +33,7 @@ exports = module.exports = Base;
* Enable coloring by default.
*/
-exports.useColors = isatty;
+exports.useColors = isatty || (process.env.MOCHA_COLORS !== undefined);
/**
* Inline diffs instead of +/-