( testPath: string, name: string, config: ResolvedConfig, customPath: string | undefined, )
| 43 | } |
| 44 | |
| 45 | export function resolveScreenshotPath( |
| 46 | testPath: string, |
| 47 | name: string, |
| 48 | config: ResolvedConfig, |
| 49 | customPath: string | undefined, |
| 50 | ): string { |
| 51 | if (customPath) { |
| 52 | return resolve(dirname(testPath), customPath) |
| 53 | } |
| 54 | const dir = dirname(testPath) |
| 55 | const base = basename(testPath) |
| 56 | if (config.browser.screenshotDirectory) { |
| 57 | return resolve( |
| 58 | config.browser.screenshotDirectory, |
| 59 | relative(config.root, dir), |
| 60 | base, |
| 61 | name, |
| 62 | ) |
| 63 | } |
| 64 | return resolve(dir, '__screenshots__', base, name) |
| 65 | } |
| 66 | |
| 67 | export async function getBrowserProvider( |
| 68 | options: ResolvedBrowserOptions, |
no test coverage detected