Skip to content

armgit / mocha

Public Imported from GitHub
0

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

Added -c, --colors. Closes #69

Tj Holowaychuk7f423018a703
diff --git a/bin/mocha b/bin/mocha
index ce14a10a..c6b672ff 100755
--- a/bin/mocha
+++ b/bin/mocha
@@ -35,6 +35,7 @@ program
.option('-t, --timeout <ms>', 'set test-case timeout in milliseconds [2000]')
.option('-s, --slow <ms>', '"slow" test threshold in milliseconds [75]', parseInt)
.option('-C, --no-colors', 'force disabling of colors')
+ .option('-c, --colors', 'force enabling of colors')
.option('-G, --growl', 'enable growl support')
// report help
@@ -97,6 +98,13 @@ var suite = new Suite('')
if (!program.colors) Base.useColors = false;
+// --colors
+
+if (~process.argv.indexOf('--colors') ||
+ ~process.argv.indexOf('-c')) {
+ Base.useColors = true;
+}
+
// --slow <ms>
if (program.slow) Base.slow = program.slow;