(suite: Suite)
| 4 | * Partition in tasks groups by consecutive concurrent |
| 5 | */ |
| 6 | export function partitionSuiteChildren(suite: Suite): Task[][] { |
| 7 | let tasksGroup: Task[] = [] |
| 8 | const tasksGroups: Task[][] = [] |
| 9 | for (const c of suite.tasks) { |
| 10 | if (tasksGroup.length === 0 || c.concurrent === tasksGroup[0].concurrent) { |
| 11 | tasksGroup.push(c) |
| 12 | } |
| 13 | else { |
| 14 | tasksGroups.push(tasksGroup) |
| 15 | tasksGroup = [c] |
| 16 | } |
| 17 | } |
| 18 | if (tasksGroup.length > 0) { |
| 19 | tasksGroups.push(tasksGroup) |
| 20 | } |
| 21 | |
| 22 | return tasksGroups |
| 23 | } |