testing: fix test wrapper not including ranges and not dealing with sync discovered root

This commit is contained in:
Connor Peet
2021-04-21 11:03:32 -07:00
parent 3c4b64079d
commit 4eee5c6ee5
2 changed files with 12 additions and 2 deletions

View File

@@ -552,7 +552,9 @@ export const createDefaultDocumentTestRoot = async <T>(
TestItemFilteredWrapper.removeFilter(document);
});
return TestItemFilteredWrapper.getWrapperForTestItem(root, document);
const wrapper = TestItemFilteredWrapper.getWrapperForTestItem(root, document);
wrapper.refreshMatch();
return wrapper;
};
/*
@@ -623,6 +625,7 @@ export class TestItemFilteredWrapper extends TestItemImpl {
this.description = actual.description;
this.error = actual.error;
this.status = actual.status;
this.range = actual.range;
this.resolveHandler = actual.resolveHandler;
const wrapperApi = getPrivateApiFor(this);
@@ -648,7 +651,7 @@ export class TestItemFilteredWrapper extends TestItemImpl {
* if the test itself has a location that matches, or if any of its
* children do.
*/
private refreshMatch() {
public refreshMatch() {
const didMatch = this._cachedMatchesFilter;
// The `children` of the wrapper only include the children who match the