Support running all tests from the root directory
Previously, if you did not specify a tests file, you had to be in the 'tests' directory for the "run all tests" functionality to work. Now it will work in any directory.
This commit is contained in:
parent
960752ea53
commit
91127741be
|
@ -23,6 +23,7 @@ program
|
||||||
|
|
||||||
if (program.tests.length === 0) {
|
if (program.tests.length === 0) {
|
||||||
program.tests = fs.readdirSync(__dirname).filter(function(f) { return (/^test\.(\w|\.|-)+\.js$/).test(f); });
|
program.tests = fs.readdirSync(__dirname).filter(function(f) { return (/^test\.(\w|\.|-)+\.js$/).test(f); });
|
||||||
|
program.tests = program.tests.map(function (f) { return path.resolve(__dirname, f); }); // add full paths in
|
||||||
console.log('using files %s', program.tests);
|
console.log('using files %s', program.tests);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue