diff --git a/packages/playwright/src/common/config.ts b/packages/playwright/src/common/config.ts index 2e8102407b..82ab07e5c6 100644 --- a/packages/playwright/src/common/config.ts +++ b/packages/playwright/src/common/config.ts @@ -194,7 +194,7 @@ export class FullProjectInternal { const stylePaths = Array.isArray(this.expect.toHaveScreenshot.stylePath) ? this.expect.toHaveScreenshot.stylePath : [this.expect.toHaveScreenshot.stylePath]; this.expect.toHaveScreenshot.stylePath = stylePaths.map(stylePath => path.resolve(configDir, stylePath)); } - this.respectGitIgnore = projectConfig.respectGitIgnore ?? config.respectGitIgnore ?? (!projectConfig.testDir && !config.testDir); + this.respectGitIgnore = takeFirst(projectConfig.respectGitIgnore, config.respectGitIgnore, !projectConfig.testDir && !config.testDir); this.ignoreSnapshots = takeFirst(configCLIOverrides.ignoreSnapshots, projectConfig.ignoreSnapshots, config.ignoreSnapshots, false); } }