Skip to content

Commit 3647975

Browse files
committed
Move compute coverage to run profile handler
1 parent 32908a8 commit 3647975

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/TestExplorer/TestRunner.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,7 @@ export class TestRunProxy {
193193
}
194194

195195
public async end() {
196-
if (!this.testRun) {
197-
return;
198-
}
199-
200-
// Compute final coverage numbers if any coverage info has been captured during the run.
201-
await this.coverage.computeCoverage(this.testRun);
202-
203-
this.testRun.end();
196+
this.testRun?.end();
204197
}
205198

206199
public appendOutput(output: string) {
@@ -210,6 +203,15 @@ export class TestRunProxy {
210203
this.queuedOutput.push(output);
211204
}
212205
}
206+
207+
public async computeCoverage() {
208+
if (!this.testRun) {
209+
return;
210+
}
211+
212+
// Compute final coverage numbers if any coverage info has been captured during the run.
213+
await this.coverage.computeCoverage(this.testRun);
214+
}
213215
}
214216

215217
/** Class used to run tests */
@@ -304,6 +306,7 @@ export class TestRunner {
304306
};
305307
}
306308
await runner.runHandler(false, TestKind.coverage, token);
309+
await runner.testRun.computeCoverage();
307310
},
308311
false,
309312
runnableTag

0 commit comments

Comments
 (0)