fix(output): clear output before global setup (#29584)

This commit is contained in:
Pavel Feldman 2024-02-20 14:24:59 -08:00 committed by GitHub
parent b811df4ac1
commit a023cd1f57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -84,12 +84,12 @@ export function createTaskRunnerForWatch(config: FullConfigInternal, reporter: R
}
function addGlobalSetupTasks(taskRunner: TaskRunner<TestRun>, config: FullConfigInternal) {
if (!config.configCLIOverrides.preserveOutputDir && !process.env.PW_TEST_NO_REMOVE_OUTPUT_DIRS)
taskRunner.addTask('clear output', createRemoveOutputDirsTask());
for (const plugin of config.plugins)
taskRunner.addTask('plugin setup', createPluginSetupTask(plugin));
if (config.config.globalSetup || config.config.globalTeardown)
taskRunner.addTask('global setup', createGlobalSetupTask());
if (!config.configCLIOverrides.preserveOutputDir && !process.env.PW_TEST_NO_REMOVE_OUTPUT_DIRS)
taskRunner.addTask('clear output', createRemoveOutputDirsTask());
}
function addRunTasks(taskRunner: TaskRunner<TestRun>, config: FullConfigInternal) {

View File

@ -19,6 +19,7 @@ const os = require('os');
const path = require('path');
const { spawnSync } = require('child_process');
const SCRIPT_NAME = path.basename(__filename);
// 1. Parse CLI arguments
const args = process.argv.slice(2);
if (args.some(arg => arg === '--help')) {