From b5e175e6e2ad5879520993238dcb21dd7db138f6 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Thu, 25 Jan 2024 11:35:17 -0800 Subject: [PATCH] fix: tolerate wrongly-typed annotations (#29162) Fixes https://github.com/microsoft/playwright/issues/29149 --- packages/html-reporter/tsconfig.json | 2 +- packages/playwright/src/reporters/html.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/html-reporter/tsconfig.json b/packages/html-reporter/tsconfig.json index 93a8b7cbd0..4fe82eab4e 100644 --- a/packages/html-reporter/tsconfig.json +++ b/packages/html-reporter/tsconfig.json @@ -4,7 +4,7 @@ "useDefineForClassFields": true, "lib": ["DOM", "DOM.Iterable", "ESNext"], "allowJs": true, - "skipLibCheck": false, + "skipLibCheck": true, "esModuleInterop": false, "allowSyntheticDefaultImports": true, "strict": true, diff --git a/packages/playwright/src/reporters/html.ts b/packages/playwright/src/reporters/html.ts index 038bb96e27..a660b2b671 100644 --- a/packages/playwright/src/reporters/html.ts +++ b/packages/playwright/src/reporters/html.ts @@ -361,7 +361,8 @@ class HtmlBuilder { botName, location, duration, - annotations: test.annotations, + // Annotations can be pushed directly, with a wrong type. + annotations: test.annotations.map(a => ({ type: a.type, description: a.description ? String(a.description) : a.description })), outcome: test.outcome(), path, results, @@ -374,7 +375,8 @@ class HtmlBuilder { botName, location, duration, - annotations: test.annotations, + // Annotations can be pushed directly, with a wrong type. + annotations: test.annotations.map(a => ({ type: a.type, description: a.description ? String(a.description) : a.description })), outcome: test.outcome(), path, ok: test.outcome() === 'expected' || test.outcome() === 'flaky',