Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
fix(defineConfig): do not add an empty project list to project-less configs (#28224)
Dmitry Gozman62d4c3fe0261
diff --git a/packages/playwright/src/common/configLoader.ts b/packages/playwright/src/common/configLoader.tsindex 4d72ed73a0..9d648ed0ea 100644--- a/packages/playwright/src/common/configLoader.ts+++ b/packages/playwright/src/common/configLoader.ts@@ -48,6 +48,9 @@ export const defineConfig = (...configs: any[]) => {]};+ if (!result.projects && !config.projects)+ continue;+const projectOverrides = new Map<string, any>();for (const project of config.projects || [])projectOverrides.set(project.name, project);diff --git a/tests/playwright-test/config.spec.ts b/tests/playwright-test/config.spec.tsindex bddbde5f57..fb2f1888d2 100644--- a/tests/playwright-test/config.spec.ts+++ b/tests/playwright-test/config.spec.ts@@ -546,6 +546,9 @@ test('should merge configs', async ({ runInlineTest }) => {command: 'echo 123',}]}));++ // Should not add an empty project list.+ expect(defineConfig({}, {}).projects).toBeUndefined();`,'a.test.ts': `import { test } from '@playwright/test';