[minor] Allow user to set colors.mode

This commit is contained in:
Maciej Małecki 2011-11-01 12:38:38 +01:00
parent 5c3d41bf4e
commit 48d4a8b263

View File

@ -29,7 +29,10 @@ var fs = require('fs'),
path = require('path'),
spawn = require('child_process').spawn,
async = require('async'),
colors = require('colors');
colors = require('colors'),
optimist = require('optimist');
optimist.argv.color && (colors.mode = optimist.argv.color);
var testTimeout = 15000;
var results = {};
@ -57,7 +60,9 @@ function runTest(test, callback) {
});
};
var tests = process.argv.slice(2);
var tests = process.argv.slice(2).filter(function (test) {
return test.substr(0, 2) != '--';
});
if (!tests.length) {
var pathPrefix = path.join(__dirname, 'simple');