()
| 166 | const results = new Map() |
| 167 | |
| 168 | const shutdownHandler = () => { |
| 169 | if (isShuttingDown) return |
| 170 | isShuttingDown = true |
| 171 | console.log('\nGracefully shutting down. Please wait...') |
| 172 | console.log('Outputting results of running tests:') |
| 173 | for (const [app, output] of runningProcesses.entries()) { |
| 174 | if (output.hasOutput()) { |
| 175 | console.log(`\nPartial results for ${app.relativePath}:\n\n`) |
| 176 | output.replay() |
| 177 | console.log('\n\n') |
| 178 | } else { |
| 179 | console.log(`ℹ️ No output captured for ${app.relativePath}`) |
| 180 | } |
| 181 | // Set result for incomplete tests |
| 182 | if (!results.has(app.relativePath)) { |
| 183 | results.set(app.relativePath, 'Incomplete') |
| 184 | } |
| 185 | } |
| 186 | printTestSummary(results) |
| 187 | // Allow some time for output to be written before exiting |
| 188 | setTimeout(() => process.exit(1), 100) |
| 189 | } |
| 190 | |
| 191 | process.on('SIGINT', shutdownHandler) |
| 192 | process.on('SIGTERM', shutdownHandler) |
nothing calls this directly
no test coverage detected