mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 20:59:10 +00:00
Add counts for ignored , measured, filtered
This commit is contained in:
parent
888824c617
commit
8ada28716a
1 changed files with 6 additions and 5 deletions
|
@ -27,6 +27,10 @@ export const exitOnFail = true;
|
||||||
let filterRegExp: RegExp | null;
|
let filterRegExp: RegExp | null;
|
||||||
const tests: TestDefinition[] = [];
|
const tests: TestDefinition[] = [];
|
||||||
|
|
||||||
|
let filtered = 0;
|
||||||
|
const ignored = 0;
|
||||||
|
const measured = 0;
|
||||||
|
|
||||||
// Must be called before any test() that needs to be filtered.
|
// Must be called before any test() that needs to be filtered.
|
||||||
export function setFilter(s: string): void {
|
export function setFilter(s: string): void {
|
||||||
filterRegExp = new RegExp(s, "i");
|
filterRegExp = new RegExp(s, "i");
|
||||||
|
@ -41,6 +45,8 @@ export function test(t: TestDefinition | TestFunction): void {
|
||||||
}
|
}
|
||||||
if (filter(name)) {
|
if (filter(name)) {
|
||||||
tests.push({ fn, name });
|
tests.push({ fn, name });
|
||||||
|
} else {
|
||||||
|
filtered++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,11 +94,6 @@ async function runTests() {
|
||||||
console.log("...", result);
|
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.
|
// Attempting to match the output of Rust's test runner.
|
||||||
const result = failed > 0 ? red_failed() : green_ok();
|
const result = failed > 0 ? red_failed() : green_ok();
|
||||||
console.log(
|
console.log(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue