We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1c08d5d commit e94044dCopy full SHA for e94044d
packages/runner/src/utils/tasks.ts
@@ -6,7 +6,22 @@ function isAtomTest(s: Task): s is Test | TaskCustom {
6
}
7
8
export function getTests(suite: Arrayable<Task>): (Test | TaskCustom)[] {
9
- return toArray(suite).flatMap(s => isAtomTest(s) ? [s] : s.tasks.flatMap(c => isAtomTest(c) ? [c] : getTests(c)))
+ const tests: (Test | TaskCustom)[] = []
10
+ const suite_arr = toArray(suite)
11
+ for (const s of suite_arr) {
12
+ if (isAtomTest(s)) {
13
+ tests.push(s)
14
+ }
15
+ else {
16
+ for (const task of s.tasks) {
17
+ if (isAtomTest(task))
18
+ tests.push(task)
19
+ else
20
+ tests.push(...getTests(task))
21
22
23
24
+ return tests
25
26
27
export function getTasks(tasks: Arrayable<Task> = []): Task[] {
0 commit comments