Skip to content

Commit

Permalink
fix(demo): update VSCode api usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed Apr 9, 2024
1 parent b229818 commit 63778b7
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions demo/src/features/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,20 +266,11 @@ void getApi().then(async api => {
run.appendOutput(`Completed ${test.id}\r\n`)
}

run.coverageProvider = {
provideFileCoverage () {
const coverage: vscode.FileCoverage[] = []
for (const [uri, statements] of coveredLines) {
coverage.push(
api.FileCoverage.fromDetails(
api.Uri.parse(uri),
statements.filter((s): s is vscode.StatementCoverage => s != null)
)
)
}

return coverage
}
for (const [uri, statements] of coveredLines) {
run.addCoverage(api.FileCoverage.fromDetails(
api.Uri.parse(uri),
statements.filter((s): s is vscode.StatementCoverage => s != null)
))
}

run.end()
Expand Down

0 comments on commit 63778b7

Please sign in to comment.