| 108 | } |
| 109 | |
| 110 | export async function autoExit() { |
| 111 | const timeout = parseInt(process.env.CODECEPT_AUTO_EXIT_TIMEOUT, 10) |
| 112 | if (timeout === 0) return |
| 113 | const exitTimeout = timeout || 2000 |
| 114 | |
| 115 | const { default: container } = await import('../container.js') |
| 116 | const helpers = container.helpers() |
| 117 | if (!helpers || !Object.values(helpers).some(h => typeof h._cleanup === 'function')) return |
| 118 | |
| 119 | const { default: recorder } = await import('../recorder.js') |
| 120 | await Promise.race([recorder.promise(), new Promise(resolve => setTimeout(resolve, exitTimeout))]) |
| 121 | process.exit(process.exitCode || 0) |
| 122 | } |
| 123 | |
| 124 | export const findConfigFile = testsPath => { |
| 125 | const extensions = ['js', 'ts'] |