(test, running = [])
| 293 | }; |
| 294 | |
| 295 | const findRunningTests = (test, running = []) => { |
| 296 | if (test.startTime !== null && !test.finished) { |
| 297 | for (let i = 0; i < test.subtests.length; i++) { |
| 298 | findRunningTests(test.subtests[i], running); |
| 299 | } |
| 300 | // Only add leaf tests (innermost running tests) |
| 301 | if (test.activeSubtests === 0 && test.name !== '<root>') { |
| 302 | ArrayPrototypePush(running, { |
| 303 | __proto__: null, |
| 304 | name: test.name, |
| 305 | nesting: test.nesting, |
| 306 | file: test.loc?.file, |
| 307 | line: test.loc?.line, |
| 308 | column: test.loc?.column, |
| 309 | }); |
| 310 | } |
| 311 | } |
| 312 | return running; |
| 313 | }; |
| 314 | |
| 315 | const terminationHandler = async () => { |
| 316 | const runningTests = findRunningTests(root); |
no outgoing calls
no test coverage detected