(filePath: string)
| 18 | } |
| 19 | |
| 20 | function resolveRunfile(filePath: string): string { |
| 21 | if (fs.existsSync(filePath)) { |
| 22 | return filePath; |
| 23 | } |
| 24 | const runfilesDir = process.env['JS_BINARY__RUNFILES'] || process.env['RUNFILES_DIR']; |
| 25 | if (runfilesDir) { |
| 26 | const candidates = [ |
| 27 | path.join(runfilesDir, filePath), |
| 28 | path.join(runfilesDir, '_main', filePath), |
| 29 | path.join(runfilesDir, filePath.replace(/^(\.\.\/)+/, '')), |
| 30 | path.join(runfilesDir, '_main', filePath.replace(/^(\.\.\/)+/, '')), |
| 31 | ]; |
| 32 | for (const c of candidates) { |
| 33 | if (fs.existsSync(c)) { |
| 34 | return c; |
| 35 | } |
| 36 | } |
| 37 | } |
| 38 | return filePath; |
| 39 | } |
| 40 | |
| 41 | export interface E2eContext { |
| 42 | driver: webdriver.WebDriver; |
no test coverage detected