chore: quote path only if contains whitespaces (#29079)

Otherwise we always quote as `trace.zip` matches \W.

This is a follow-up to 674988c633
Reference https://github.com/microsoft/playwright/issues/29039
This commit is contained in:
Yury Semikhatsky 2024-01-19 16:52:39 -08:00 committed by GitHub
parent d61f99034a
commit d7958ba4ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}