chore(ct): replace find-related-test-files hook with populateDependencies
This commit is contained in:
parent
c74843a914
commit
2d8c3d6800
|
|
@ -32,7 +32,6 @@ const defineConfig = (...configs) => {
|
|||
cli: {
|
||||
'clear-cache': clearCacheCommand,
|
||||
'dev-server': runDevServerCommand,
|
||||
'find-related-test-files': findRelatedTestFilesCommand,
|
||||
},
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { affectedTestFiles, cacheDir } from 'playwright/lib/transform/compilationCache';
|
||||
import { buildBundle } from './vitePlugin';
|
||||
import { cacheDir } from 'playwright/lib/transform/compilationCache';
|
||||
import { resolveDirs } from './viteUtils';
|
||||
import { runDevServer } from './devServer';
|
||||
import type { FullConfigInternal } from 'playwright/lib/common/config';
|
||||
|
|
@ -29,11 +28,6 @@ export async function clearCacheCommand(config: FullConfigInternal) {
|
|||
await removeFolderAndLogToConsole(cacheDir);
|
||||
}
|
||||
|
||||
export async function findRelatedTestFilesCommand(files: string[], config: FullConfigInternal) {
|
||||
await buildBundle(config.config, config.configDir);
|
||||
return { testFiles: affectedTestFiles(files) };
|
||||
}
|
||||
|
||||
export async function runDevServerCommand(config: FullConfigInternal) {
|
||||
return await runDevServer(config);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,9 +143,8 @@ export class Runner {
|
|||
return { errors: result.errors, testFiles: [] };
|
||||
|
||||
const resolvedFiles = (files as string[]).map(file => path.resolve(process.cwd(), file));
|
||||
const override = (this._config.config as any)['@playwright/test']?.['cli']?.['find-related-test-files'];
|
||||
if (override)
|
||||
return await override(resolvedFiles, this._config);
|
||||
for (const plugin of this._config.plugins)
|
||||
await plugin.instance?.populateDependencies?.();
|
||||
return { testFiles: affectedTestFiles(resolvedFiles) };
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue