(...startDirs: string[])
| 5 | ); |
| 6 | |
| 7 | function findProjectRoot(...startDirs: string[]) { |
| 8 | for (const startDir of startDirs) { |
| 9 | let currentDir = path.resolve(startDir); |
| 10 | while (true) { |
| 11 | const hasMarkers = |
| 12 | fs.existsSync(path.join(currentDir, 'package.json')) && |
| 13 | fs.existsSync(path.join(currentDir, 'scripts/run-prepare-local-update-artifacts.js')) && |
| 14 | fs.existsSync(path.join(currentDir, 'scripts/local-e2e-server.ts')); |
| 15 | |
| 16 | if (hasMarkers) { |
| 17 | return currentDir; |
| 18 | } |
| 19 | |
| 20 | const parentDir = path.dirname(currentDir); |
| 21 | if (parentDir === currentDir) { |
| 22 | break; |
| 23 | } |
| 24 | currentDir = parentDir; |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | throw new Error('Unable to resolve the e2etest project root.'); |
| 29 | } |
| 30 | |
| 31 | const projectRoot = findProjectRoot(process.cwd(), __dirname); |
| 32 | const pidFile = path.join(projectRoot, '.e2e-artifacts/.server.pid'); |
no test coverage detected