summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/asserts.ts2
-rw-r--r--testing/bench_test.ts4
-rw-r--r--testing/format.ts2
-rw-r--r--testing/format_test.ts1
-rw-r--r--testing/mod.ts11
5 files changed, 10 insertions, 10 deletions
diff --git a/testing/asserts.ts b/testing/asserts.ts
index 28dfa7911..230e2c8d2 100644
--- a/testing/asserts.ts
+++ b/testing/asserts.ts
@@ -235,7 +235,7 @@ export function assertArrayContains(
expected: unknown[],
msg?: string
): void {
- let missing: unknown[] = [];
+ const missing: unknown[] = [];
for (let i = 0; i < expected.length; i++) {
let found = false;
for (let j = 0; j < actual.length; j++) {
diff --git a/testing/bench_test.ts b/testing/bench_test.ts
index 1c6459bbb..8af2f0d6d 100644
--- a/testing/bench_test.ts
+++ b/testing/bench_test.ts
@@ -19,7 +19,7 @@ test(async function benching(): Promise<void> {
bench(async function forAwaitFetchDenolandX10(b): Promise<void> {
b.start();
for (let i = 0; i < 10; i++) {
- let r = await fetch("https://deno.land/");
+ const r = await fetch("https://deno.land/");
await r.text();
}
b.stop();
@@ -31,7 +31,7 @@ test(async function benching(): Promise<void> {
await Promise.all(
urls.map(
async (denoland: string): Promise<void> => {
- let r = await fetch(denoland);
+ const r = await fetch(denoland);
await r.text();
}
)
diff --git a/testing/format.ts b/testing/format.ts
index 06c1b6818..953347c27 100644
--- a/testing/format.ts
+++ b/testing/format.ts
@@ -271,7 +271,7 @@ function printIteratorEntries(
// Too bad, so sad that separator for ECMAScript Map has been ' => '
// What a distracting diff if you change a data structure to/from
// ECMAScript Object or Immutable.Map/OrderedMap which use the default.
- separator: string = ": "
+ separator = ": "
): string {
let result = "";
let current = iterator.next();
diff --git a/testing/format_test.ts b/testing/format_test.ts
index 39884d484..e2bb8df23 100644
--- a/testing/format_test.ts
+++ b/testing/format_test.ts
@@ -13,6 +13,7 @@ import { format } from "./format.ts";
// eslint-disable-next-line max-len
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-explicit-any
function returnArguments(...args: any[]): IArguments {
+ // eslint-disable-next-line prefer-rest-params
return arguments;
}
diff --git a/testing/mod.ts b/testing/mod.ts
index 329e02895..3b6386d5b 100644
--- a/testing/mod.ts
+++ b/testing/mod.ts
@@ -62,7 +62,7 @@ function disableConsole(): void {
}
const encoder = new TextEncoder();
-function print(txt: string, newline: boolean = true): void {
+function print(txt: string, newline = true): void {
if (newline) {
txt += "\n";
}
@@ -172,11 +172,11 @@ function createTestResults(tests: TestDefinition[]): TestResults {
);
}
-function formatTestTime(time: number = 0): string {
+function formatTestTime(time = 0): string {
return `${time.toFixed(2)}ms`;
}
-function promptTestTime(time: number = 0, displayWarning = false): string {
+function promptTestTime(time = 0, displayWarning = false): string {
// if time > 5s we display a warning
// only for test time, not the full runtime
if (displayWarning && time >= 5000) {
@@ -308,10 +308,9 @@ async function runTestsSerial(
print(`${yellow("RUNNING")} ${name}`, false);
}
try {
- let start, end;
- start = performance.now();
+ const start = performance.now();
await fn();
- end = performance.now();
+ const end = performance.now();
if (disableLog) {
// Rewriting the current prompt line to erase `running ....`
print(CLEAR_LINE, false);