allow filtering tests in browser runner
This commit is contained in:
parent
5a03993f65
commit
c5edaa3608
1 changed files with 8 additions and 0 deletions
|
|
@ -72,6 +72,8 @@ document.body.appendChild(nav);
|
||||||
if (location.search)
|
if (location.search)
|
||||||
testNames = location.search.substr(1).split(",")
|
testNames = location.search.substr(1).split(",")
|
||||||
|
|
||||||
|
var filter = location.hash.substr(1);
|
||||||
|
|
||||||
require(testNames, function() {
|
require(testNames, function() {
|
||||||
var tests = testNames.map(function(x) {
|
var tests = testNames.map(function(x) {
|
||||||
var module = require(x);
|
var module = require(x);
|
||||||
|
|
@ -81,6 +83,12 @@ require(testNames, function() {
|
||||||
|
|
||||||
async.list(tests)
|
async.list(tests)
|
||||||
.expand(function(test) {
|
.expand(function(test) {
|
||||||
|
if (filter) {
|
||||||
|
Object.keys(test).forEach(function(method) {
|
||||||
|
if (method.match(/^>?test/) && !method.match(filter))
|
||||||
|
test[method] = undefined;
|
||||||
|
});
|
||||||
|
}
|
||||||
return AsyncTest.testcase(test)
|
return AsyncTest.testcase(test)
|
||||||
}, AsyncTest.TestGenerator)
|
}, AsyncTest.TestGenerator)
|
||||||
.run()
|
.run()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue