diff --git a/src/Console/DuskCommand.php b/src/Console/DuskCommand.php index 0701b2367..3e46d5660 100644 --- a/src/Console/DuskCommand.php +++ b/src/Console/DuskCommand.php @@ -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); }