Skip to content

Commit

Permalink
Fixes unknown option "--ansi" and "--no-ansi"
Browse files Browse the repository at this point in the history
fixes #1066

Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Oct 14, 2023
1 parent 6a60371 commit ce0d197
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Console/DuskCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,21 @@ protected function phpunitArguments($options)
}

$options = array_values(array_filter($options, function ($option) {
return ! Str::startsWith($option, ['--env=', '--pest']);
return ! Str::startsWith($option, ['--env=', '--pest', '--ansi', '--no-ansi']);
}));

if (! file_exists($file = base_path('phpunit.dusk.xml'))) {
$file = base_path('phpunit.dusk.xml.dist');
}

if ($this->option('ansi')) {
$options[] = '--colors="always"';
}

if ($this->option('no-ansi')) {
$options[] = '--colors="never"';
}

return array_merge(['-c', $file], $options);
}

Expand Down

0 comments on commit ce0d197

Please sign in to comment.