diff options
author | Samrith Shankar <samrith-s@users.noreply.github.com> | 2020-03-20 14:38:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-20 09:38:34 -0400 |
commit | 798904b0f2ed0c7284b67bba2f125f406b5850de (patch) | |
tree | 5aba8d35aa8984aa778c894258bcaed56f1ce17c /cli/js/testing.ts | |
parent | 35f6e2e45ddb96524a6bdf54b0a6155caa88d5e0 (diff) |
Add require-await lint rule (#4401)
Diffstat (limited to 'cli/js/testing.ts')
-rw-r--r-- | cli/js/testing.ts | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/cli/js/testing.ts b/cli/js/testing.ts index 08bb2db87..22e719719 100644 --- a/cli/js/testing.ts +++ b/cli/js/testing.ts @@ -289,7 +289,7 @@ export class ConsoleTestReporter implements TestReporter { this.encoder = new TextEncoder(); } - private log(msg: string, noNewLine = false): void { + private log(msg: string, noNewLine = false): Promise<void> { if (!noNewLine) { msg += "\n"; } @@ -298,19 +298,22 @@ export class ConsoleTestReporter implements TestReporter { // compared to `console.log`; `core.print` on the other hand // is line-buffered and doesn't output message without newline stdout.writeSync(this.encoder.encode(msg)); + return Promise.resolve(); } - async start(event: TestEventStart): Promise<void> { + start(event: TestEventStart): Promise<void> { this.log(`running ${event.tests} tests`); + return Promise.resolve(); } - async testStart(event: TestEventTestStart): Promise<void> { + testStart(event: TestEventTestStart): Promise<void> { const { name } = event; this.log(`test ${name} ... `, true); + return Promise.resolve(); } - async testEnd(event: TestEventTestEnd): Promise<void> { + testEnd(event: TestEventTestEnd): Promise<void> { const { result } = event; switch (result.status) { @@ -324,9 +327,11 @@ export class ConsoleTestReporter implements TestReporter { this.log(`${YELLOW_IGNORED} ${formatDuration(result.duration)}`); break; } + + return Promise.resolve(); } - async end(event: TestEventEnd): Promise<void> { + end(event: TestEventEnd): Promise<void> { const { stats, duration, results } = event; // Attempting to match the output of Rust's test runner. const failedTests = results.filter(r => r.error); @@ -354,6 +359,8 @@ export class ConsoleTestReporter implements TestReporter { `${stats.filtered} filtered out ` + `${formatDuration(duration)}\n` ); + + return Promise.resolve(); } } |