$TINYTEST_FILTER to only run some tests

I have typed `if (! test.name.match(/foo/)) return` an average of 4
times a week for the past several years.  No more.
This commit is contained in:
David Glasser
2015-02-25 14:44:49 -08:00
parent b3c49b5fa1
commit c69e990152

View File

@@ -404,6 +404,10 @@ _.extend(TestManager.prototype, {
throw new Error(
"Every test needs a unique name, but there are two tests named '" +
test.name + "'");
if (process.env.TINYTEST_FILTER &&
test.name.indexOf(process.env.TINYTEST_FILTER) === -1) {
return;
}
self.tests[test.name] = test;
self.ordered_tests.push(test);
},