summaryrefslogtreecommitdiff
path: root/cli/js/testing.ts
diff options
context:
space:
mode:
authorStanislav <62983943+stanislavstrelnikov@users.noreply.github.com>2020-07-07 04:45:39 +0300
committerGitHub <noreply@github.com>2020-07-06 21:45:39 -0400
commit158ae0bfe900d2bac3076390c4fe3d2b54d94fe5 (patch)
tree209e4b5682e2a899041767c49428e34329e48084 /cli/js/testing.ts
parentab4c574f5202f607ceb6068f56b3cc8aed1bbbaf (diff)
clean up code in cli/js (#6611)
Diffstat (limited to 'cli/js/testing.ts')
-rw-r--r--cli/js/testing.ts15
1 files changed, 8 insertions, 7 deletions
diff --git a/cli/js/testing.ts b/cli/js/testing.ts
index 64ae6f0b3..e8d42c2eb 100644
--- a/cli/js/testing.ts
+++ b/cli/js/testing.ts
@@ -1,4 +1,5 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
+
import { gray, green, italic, red, yellow } from "./colors.ts";
import { exit } from "./ops/os.ts";
import { Console, stringifyArgs } from "./web/console.ts";
@@ -11,9 +12,9 @@ import { assert } from "./util.ts";
const disabledConsole = new Console((): void => {});
-function delay(n: number): Promise<void> {
- return new Promise((resolve: () => void, _) => {
- setTimeout(resolve, n);
+function delay(ms: number): Promise<void> {
+ return new Promise((resolve: () => void) => {
+ setTimeout(resolve, ms);
});
}
@@ -241,7 +242,7 @@ class TestRunner {
passed: 0,
failed: 0,
};
- private usedOnly: boolean;
+ readonly #usedOnly: boolean;
constructor(
tests: TestDefinition[],
@@ -249,8 +250,8 @@ class TestRunner {
public failFast: boolean
) {
const onlyTests = tests.filter(({ only }) => only);
- this.usedOnly = onlyTests.length > 0;
- const unfilteredTests = this.usedOnly ? onlyTests : tests;
+ this.#usedOnly = onlyTests.length > 0;
+ const unfilteredTests = this.#usedOnly ? onlyTests : tests;
this.testsToRun = unfilteredTests.filter(filterFn);
this.stats.filtered = unfilteredTests.length - this.testsToRun.length;
}
@@ -292,7 +293,7 @@ class TestRunner {
const duration = +new Date() - suiteStart;
yield {
- end: { ...this.stats, usedOnly: this.usedOnly, duration, results },
+ end: { ...this.stats, usedOnly: this.#usedOnly, duration, results },
};
}
}