Skip to content

Commit 334917f

Browse files
authoredMar 12, 2024
chore(test): exclude the github reporter from playwright tests for now (#5959)
1 parent 15f53bd commit 334917f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed
 

‎playwright.config.ts

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {defineConfig} from '@playwright/test'
1+
import {defineConfig, type PlaywrightTestConfig} from '@playwright/test'
22
import {createPlaywrightConfig} from '@sanity/test'
33

44
import {loadEnvFiles} from './scripts/utils/loadEnvFiles'
@@ -8,12 +8,24 @@ loadEnvFiles()
88

99
const CI = readBoolEnv('CI', false)
1010

11+
/**
12+
* Excludes the GitHub reporter until https://github.com/microsoft/playwright/issues/19817 is resolved, since it creates a lot of noise in our PRs.
13+
* @param reporters - The reporters config to exclude the github reporter from
14+
*/
15+
function excludeGithub(reporters: PlaywrightTestConfig['reporter']) {
16+
if (Array.isArray(reporters)) {
17+
return reporters.filter((reporterDescription) => reporterDescription[0] !== 'github')
18+
}
19+
return reporters === 'github' ? undefined : reporters
20+
}
21+
1122
const playwrightConfig = createPlaywrightConfig({
1223
projectId: readEnv('SANITY_E2E_PROJECT_ID'),
1324
token: readEnv('SANITY_E2E_SESSION_TOKEN'),
1425
playwrightOptions(config) {
1526
return {
1627
...config,
28+
reporter: excludeGithub(config.reporter),
1729
use: {
1830
...config.use,
1931
baseURL: 'http://localhost:3339',

0 commit comments

Comments
 (0)
Please sign in to comment.