Skip to content

Commit

Permalink
testing: allow invalidateTestResults to take an array (#183569)
Browse files Browse the repository at this point in the history
  • Loading branch information
connor4312 authored May 26, 2023
1 parent 1942c0e commit d15a0aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/vs/workbench/api/common/extHostTesting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,12 @@ export class ExtHostTesting implements ExtHostTestingShape {
createTestRun: (request, name, persist = true) => {
return this.runTracker.createTestRun(controllerId, collection, request, name, persist);
},
invalidateTestResults: item => {
invalidateTestResults: items => {
checkProposedApiEnabled(extension, 'testInvalidateResults');
const id = item ? TestId.fromExtHostTestItem(item, controllerId).toString() : controllerId;
return this.proxy.$markTestRetired(id);
for (const item of items instanceof Array ? items : [items]) {
const id = item ? TestId.fromExtHostTestItem(item, controllerId).toString() : controllerId;
this.proxy.$markTestRetired(id);
}
},
set resolveHandler(fn) {
collection.resolveHandler = fn;
Expand Down
2 changes: 1 addition & 1 deletion src/vscode-dts/vscode.proposed.testInvalidateResults.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ declare module 'vscode' {
*
* @param item Item to mark as outdated. If undefined, all the controller's items are marked outdated.
*/
invalidateTestResults(item?: TestItem): void;
invalidateTestResults(items?: TestItem | readonly TestItem[]): void;
}
}

0 comments on commit d15a0aa

Please sign in to comment.