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
No known key found for this signature in database
GPG key ID: CF8FD2EA0DBC61BD
2 changed files with 12 additions and 2 deletions

7
.vscode/launch.json vendored
View file

@ -199,6 +199,13 @@
"name": "Attach to VS Code",
"browserAttachLocation": "workspace",
"port": 9222,
"trace": true,
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"resolveSourceMapLocations": [
"${workspaceFolder}/out/**/*.js"
],
"perScriptSourcemaps": "yes"
},
{

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