* Only test a subset of tests with `?include=Foo` or `?exclude=Foo` in the URL. * Can be used together with ` ` * Sample usage: * for (const test of tests) { * subsetTestByKey("Foo", async_test, test.fn, test.name); * }
(key, testFunc, ...args)
| 66 | * } |
| 67 | */ |
| 68 | function subsetTestByKey(key, testFunc, ...args) { |
| 69 | if (collectKeys) { |
| 70 | if (collectCounts && key in keys) { |
| 71 | keys[key]++; |
| 72 | } else { |
| 73 | keys[key] = 1; |
| 74 | } |
| 75 | } |
| 76 | if (shouldRunSubTest(key)) { |
| 77 | return testFunc(...args); |
| 78 | } |
| 79 | return null; |
| 80 | } |
| 81 | self.shouldRunSubTest = shouldRunSubTest; |
| 82 | self.subsetTestByKey = subsetTestByKey; |
| 83 | })(); |
no test coverage detected