From 51f309887a78441988867f8d6202791c5569bb25 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Wed, 7 Aug 2024 16:06:35 +0200 Subject: [PATCH] chore: Update reporter configuration property name #17 --- README.md | 2 +- playwright.config.ts | 6 +++--- src/index.ts | 4 ++-- src/models/GitHubActionOptions.ts | 2 +- src/utils/processResults.ts | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3b0ae8e..c3241c4 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ The reporter supports the following configuration options: | showAnnotations | Show annotations from tests | `true` | | showTags | Show tags from tests | `true` | | showError | Show error message in summary | `false` | -| report | Define which types of test results should be shown in the summary | `['pass', 'skipped', 'fail', 'flaky']` | +| includeResults | Define which types of test results should be shown in the summary | `['pass', 'skipped', 'fail', 'flaky']` | | quiet | Do not show any output in the console | `false` | To use these option, you can update the reporter configuration: diff --git a/playwright.config.ts b/playwright.config.ts index a0b9153..feaaf7b 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -20,7 +20,7 @@ const config: PlaywrightTestConfig<{}, {}> = { useDetails: false, showError: true, quiet: false, - report: ["fail", "flaky", "skipped"], + includeResults: ["fail", "flaky", "skipped"], }, ], [ @@ -30,7 +30,7 @@ const config: PlaywrightTestConfig<{}, {}> = { useDetails: false, showError: true, quiet: false, - report: ["pass", "skipped"], + includeResults: ["pass", "skipped"], }, ], [ @@ -39,7 +39,7 @@ const config: PlaywrightTestConfig<{}, {}> = { title: "Reporter (details: true, report: fail, flaky, skipped)", useDetails: true, quiet: true, - report: ["fail", "flaky", "skipped"], + includeResults: ["fail", "flaky", "skipped"], }, ], ], diff --git a/src/index.ts b/src/index.ts index e336083..9914574 100644 --- a/src/index.ts +++ b/src/index.ts @@ -31,8 +31,8 @@ class GitHubAction implements Reporter { this.options.showTags = true; } - if (typeof options.report === "undefined") { - this.options.report = ["fail", "flaky", "pass", "skipped"]; + if (typeof options.includeResults === "undefined") { + this.options.includeResults = ["fail", "flaky", "pass", "skipped"]; } if (process.env.NODE_ENV === "development") { diff --git a/src/models/GitHubActionOptions.ts b/src/models/GitHubActionOptions.ts index aa571e1..f70d96f 100644 --- a/src/models/GitHubActionOptions.ts +++ b/src/models/GitHubActionOptions.ts @@ -7,5 +7,5 @@ export interface GitHubActionOptions { showTags: boolean; showError?: boolean; quiet?: boolean; - report?: DisplayLevel[]; + includeResults?: DisplayLevel[]; } diff --git a/src/utils/processResults.ts b/src/utils/processResults.ts index c1beba5..d511f65 100644 --- a/src/utils/processResults.ts +++ b/src/utils/processResults.ts @@ -56,7 +56,7 @@ export const processResults = async ( options.showAnnotations, options.showTags, !!options.showError, - options.report as DisplayLevel[] + options.includeResults as DisplayLevel[] ); if (!content) { @@ -76,7 +76,7 @@ export const processResults = async ( options.showAnnotations, options.showTags, !!options.showError, - options.report as DisplayLevel[] + options.includeResults as DisplayLevel[] ); if (tableRows.length !== 0) {