diff options
author | ztplz <mysticzt@gmail.com> | 2018-10-10 15:08:09 +0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-10-10 08:03:59 -0400 |
commit | 8ada28716a72f062989da4b3a56b42427ba4fb81 (patch) | |
tree | 03817baaede0c00f4615ccde2c016035a5014f72 /js/testing/testing.ts | |
parent | 888824c61787edb4a1a0d4141f6c08855d87d2b7 (diff) |
Add counts for ignored , measured, filtered
Diffstat (limited to 'js/testing/testing.ts')
-rw-r--r-- | js/testing/testing.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/js/testing/testing.ts b/js/testing/testing.ts index 1e2f4c416..ff91ddebc 100644 --- a/js/testing/testing.ts +++ b/js/testing/testing.ts @@ -27,6 +27,10 @@ export const exitOnFail = true; let filterRegExp: RegExp | null; const tests: TestDefinition[] = []; +let filtered = 0; +const ignored = 0; +const measured = 0; + // Must be called before any test() that needs to be filtered. export function setFilter(s: string): void { filterRegExp = new RegExp(s, "i"); @@ -41,6 +45,8 @@ export function test(t: TestDefinition | TestFunction): void { } if (filter(name)) { tests.push({ fn, name }); + } else { + filtered++; } } @@ -88,11 +94,6 @@ async function runTests() { console.log("...", result); } - // TODO counts for ignored , measured, filtered. - const filtered = 0; - const ignored = 0; - const measured = 0; - // Attempting to match the output of Rust's test runner. const result = failed > 0 ? red_failed() : green_ok(); console.log( |