mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 20:07:49 +00:00
Add a --time-limit option to test-build.js so travis-ci can complete its test runs.
Former-commit-id: 742b17208d6c9316efea33c106e7689b9290f48d
This commit is contained in:
@@ -47,6 +47,6 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "node ./build.js",
|
"build": "node ./build.js",
|
||||||
"test": "node ./test/test.js && node ./test/test.js ./lodash.min.js && node ./test/test-build.js"
|
"test": "node ./test/test.js && node ./test/test.js ./lodash.min.js && node ./test/test-build.js --time-limit 45"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,11 @@
|
|||||||
var QUnit = global.QUnit = require('../vendor/qunit/qunit/qunit.js');
|
var QUnit = global.QUnit = require('../vendor/qunit/qunit/qunit.js');
|
||||||
require('../vendor/qunit-clib/qunit-clib.js');
|
require('../vendor/qunit-clib/qunit-clib.js');
|
||||||
|
|
||||||
|
/** The time limit for the tests to run (minutes) */
|
||||||
|
var timeLimit = process.argv.reduce(function(result, value, index) {
|
||||||
|
return (/--time-limit/.test(value) && parseFloat(process.argv[index + 1])) || result;
|
||||||
|
}, Infinity);
|
||||||
|
|
||||||
/** Used to associate aliases with their real names */
|
/** Used to associate aliases with their real names */
|
||||||
var aliasToRealMap = {
|
var aliasToRealMap = {
|
||||||
'all': 'every',
|
'all': 'every',
|
||||||
@@ -1178,4 +1183,9 @@
|
|||||||
});
|
});
|
||||||
}());
|
}());
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
if (isFinite(timeLimit)) {
|
||||||
|
setTimeout(process.exit, timeLimit * 6e4);
|
||||||
|
}
|
||||||
}());
|
}());
|
||||||
|
|||||||
Reference in New Issue
Block a user