diff --git a/packages/playwright/src/reporters/base.ts b/packages/playwright/src/reporters/base.ts index 81d0fa567e..91f34faf74 100644 --- a/packages/playwright/src/reporters/base.ts +++ b/packages/playwright/src/reporters/base.ts @@ -374,7 +374,7 @@ export function formatFailure(config: FullConfig, test: TestCase, options: {inde } function quotePathIfNeeded(path: string): string { - if (/\W/.test(path)) + if (/\s/.test(path)) return `"${path}"`; return path; }