Skip to content

Commit

Permalink
Add counts for ignored , measured, filtered
Browse files Browse the repository at this point in the history
  • Loading branch information
ztplz authored and ry committed Oct 10, 2018
1 parent 888824c commit 8ada287
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions js/testing/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -41,6 +45,8 @@ export function test(t: TestDefinition | TestFunction): void {
}
if (filter(name)) {
tests.push({ fn, name });
} else {
filtered++;
}
}

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 8ada287

Please sign in to comment.