| 33 | public readonly children: TreeNode[] = []; |
| 34 | |
| 35 | getHighestChildStatus(includeSkipped: boolean): TestStatus { |
| 36 | const statuses = new Set<TestStatus>(); |
| 37 | const addStatus = (node: TreeNode) => { |
| 38 | if (node !== this && node instanceof TestNode) |
| 39 | statuses.add(node.status); |
| 40 | for (const child of node.children) |
| 41 | addStatus(child); |
| 42 | }; |
| 43 | addStatus(this); |
| 44 | |
| 45 | // Always include Skipped status for Suite nodes that have only that status, else they'll |
| 46 | // show as unknown. |
| 47 | if (!includeSkipped && this instanceof SuiteNode && statuses.size === 1 && statuses.has(TestStatus.Skipped)) |
| 48 | includeSkipped = true; |
| 49 | const validStatues = [...statuses].filter((s) => includeSkipped || s !== TestStatus.Skipped); |
| 50 | return validStatues.length |
| 51 | ? Math.max(...validStatues) |
| 52 | : TestStatus.Unknown; |
| 53 | } |
| 54 | |
| 55 | get label(): string | undefined { |
| 56 | const name = this instanceof GroupNode |