testing: allow invalidateTestResults to take an array (#183569)

This commit is contained in:
Connor Peet 2023-05-26 11:07:50 -07:00 committed by GitHub
parent 1942c0eccc
commit d15a0aa70c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -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;

View file

@ -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;
}
}