Skip to content

Commit

Permalink
testing: fix test wrapper not including ranges and not dealing with s…
Browse files Browse the repository at this point in the history
…ync discovered root
  • Loading branch information
connor4312 committed Apr 21, 2021
1 parent 3c4b640 commit 4eee5c6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand Down
7 changes: 5 additions & 2 deletions src/vs/workbench/api/common/extHostTesting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

/*
Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand Down

0 comments on commit 4eee5c6

Please sign in to comment.