MCPcopy
hub / github.com/vitest-dev/vitest / partitionSuiteChildren

Function partitionSuiteChildren

packages/runner/src/utils/suite.ts:6–23  ·  view source on GitHub ↗
(suite: Suite)

Source from the content-addressed store, hash-verified

4 * Partition in tasks groups by consecutive concurrent
5 */
6export 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}

Callers 1

runSuiteFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected