From d7958ba4ad4e6d656ae030b76e07893cd11d254e Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 19 Jan 2024 16:52:39 -0800 Subject: [PATCH] chore: quote path only if contains whitespaces (#29079) Otherwise we always quote as `trace.zip` matches \W. This is a follow-up to 674988c633fb39b1d66a6bda55e96aaaa172dde5 Reference https://github.com/microsoft/playwright/issues/29039 --- packages/playwright/src/reporters/base.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }