Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
recca0120 committed Feb 24, 2025
1 parent c89aa06 commit 64cd2b6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/TestCollection/TestHierarchyBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,31 +51,31 @@ export class TestHierarchyBuilder {
let testItem: TestItem | undefined;
let parts = testDefinition.label?.split('\\') ?? [];
parts = parts.filter(value => !!value);
this.length = parts.length;

parts.forEach((part, index, parts) => {
const type = TestType.namespace;

const classFQN = parts.slice(0, index + 1).join('\\');
const id = transformer.uniqueId({ type, classFQN });
const label = transformer.generateLabel({ type, classFQN: part });
const testDefinition = { type, id, namespace: classFQN, label, depth: index + 1 } as TestDefinition;

testItem = children.get(id);
testItem = children.get(testDefinition.id);
if (!testItem) {
const label = transformer.generateLabel({ type, classFQN: part });
const testDefinition = { type, id, namespace: classFQN, label, depth: index + 1 } as TestDefinition;
testItem = this.ctrl.createTestItem(id, this.parseLabelWithIcon(testDefinition));
testItem = this.ctrl.createTestItem(testDefinition.id, this.parseLabelWithIcon(testDefinition));
testItem.canResolveChildren = true;
testItem.sortText = id;
testItem.sortText = testDefinition.id;
children.add(testItem);
this.testData.set(testItem, new TestCase(testDefinition));
}

const parent = this.ancestors[this.ancestors.length - 1];
parent.children.push(testItem);
this.ancestors.push({ item: testItem, type, children: [] });
this.ancestors.push({ item: testItem, type: testDefinition.type, children: [] });

children = testItem.children;
});
this.length = this.ancestors.length - 1;
}

private addTestItem(testDefinition: TestDefinition, sortText: string) {
Expand Down

0 comments on commit 64cd2b6

Please sign in to comment.