()
| 103 | resolve(spawnTest(cmd, args, options, reportStatus, startTime, testAttempts)); |
| 104 | }; |
| 105 | const onOutputChange = () => { |
| 106 | // Extract initial status (i.e. how many tests there are in this shard) |
| 107 | if (initialStatusRegex.test(output) && state === 'setup') { |
| 108 | max = Number(output.match(initialStatusRegex)[1]); |
| 109 | } |
| 110 | if (/Running initializer/.test(output) && state === 'setup') { |
| 111 | state = 'initializing'; |
| 112 | } |
| 113 | if (/Running test/.test(output) && state === 'initializing') { |
| 114 | state = 'testing'; |
| 115 | } |
| 116 | if (state === 'testing') { |
| 117 | const oldLastIndex = testProgressRegex.lastIndex; |
| 118 | const newMatch = testProgressRegex.exec(stripVTControlCharacters(output))?.[1]; |
| 119 | // Do not advance the Regex, or more precisely, reset to index `0`. |
| 120 | if (newMatch === undefined) { |
| 121 | testProgressRegex.lastIndex = oldLastIndex; |
| 122 | } else { |
| 123 | current = Number(newMatch); |
| 124 | } |
| 125 | } |
| 126 | syncStatus(); |
| 127 | }; |
| 128 | proc.stdout.on('data', (data) => { |
| 129 | output += data; |
| 130 | onOutputChange(); |
no test coverage detected