Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
assign testItem from children only if matching child
Browse files Browse the repository at this point in the history
  • Loading branch information
snutij committed Jan 4, 2024
1 parent cd3572b commit b7bf5fe
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/testController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,15 +400,20 @@ export class TestController {
testItems.forEach((test) => {
if (testItem) return;

if (test.children.size > 0) {
testItem = this.findTestByActiveLine(editor, test.children);
} else if (
if (
test.uri?.toString() === editor.document.uri.toString() &&
test.range?.start.line! <= line &&
test.range?.end.line! >= line
) {
testItem = test;
}

if (test.children.size > 0) {
const childInRange = this.findTestByActiveLine(editor, test.children);
if (childInRange) {
testItem = childInRange;
}
}
});

return testItem;
Expand Down

0 comments on commit b7bf5fe

Please sign in to comment.