mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-13 07:35:33 +03:00
fix(defineConfig): do not add an empty project list to project-less configs (#28224)
Otherwise, merging two configs without `projects` property will create a config with an empty project list, which is semantically different and always leads to "No tests found".
This commit is contained in:
parent
11bf96fe98
commit
62d4c3fe02
@ -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);
|
||||
|
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user