Skip to content

Commit f858852

Browse files
authored
Fix running unit tests from a root test item (intersystems-community#1669)
1 parent 1b9418a commit f858852

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/commands/unitTest.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ const textDecoder = new TextDecoder();
6262
/** Find the root `TestItem` for `uri` */
6363
function rootItemForItem(testController: vscode.TestController, uri: vscode.Uri): vscode.TestItem | undefined {
6464
let rootItem: vscode.TestItem;
65+
const uriString = uri.toString();
6566
for (const [, i] of testController.items) {
66-
if (uriIsParentOf(i.uri, uri)) {
67+
if (uriIsParentOf(i.uri, uri) || uriString == i.uri.toString()) {
6768
rootItem = i;
6869
break;
6970
}
@@ -421,9 +422,10 @@ async function runHandler(
421422

422423
// Add the initial items to the queue to process
423424
const queue: vscode.TestItem[] = [];
425+
const rootUriString = root.uri.toString();
424426
if (request.include?.length) {
425427
request.include.forEach((i) => {
426-
if (uriIsParentOf(root.uri, i.uri)) {
428+
if (uriIsParentOf(root.uri, i.uri) || i.uri.toString() == rootUriString) {
427429
queue.push(i);
428430
}
429431
});

0 commit comments

Comments
 (0)