From aa42c2ec7248059ff5903ff11aa6eeabc04329bf Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Mon, 26 Apr 2021 10:11:43 -0700 Subject: [PATCH] update testing api --- test-provider-sample/src/testController.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test-provider-sample/src/testController.ts b/test-provider-sample/src/testController.ts index 5bf1e48e..8906c021 100644 --- a/test-provider-sample/src/testController.ts +++ b/test-provider-sample/src/testController.ts @@ -25,7 +25,7 @@ export class MathTestController implements vscode.TestController, cancellation: vscode.CancellationToken) { - const run = vscode.test.createTestRunTask(request); + const run = vscode.test.createTestRun(request); const runTests = async (tests: Iterable>) => { for (const test of tests) { if (request.exclude?.includes(test)) { @@ -220,6 +220,7 @@ class TestFile { }); this.prune(thisGeneration); + this.item.error = this.item.children.size === 0 ? new vscode.MarkdownString('No _tests_ were **found** in this file') : undefined; } /** @@ -290,7 +291,7 @@ class TestCase { public generation: number, ) { } - async run(options: vscode.TestRunTask): Promise { + async run(options: vscode.TestRun): Promise { await new Promise(resolve => setTimeout(resolve, 1000 + Math.random() * 1000)); const start = Date.now(); const actual = this.evaluate();