Skip to content

Commit

Permalink
Fixes unknown option "--ansi" and "--no-ansi" (#1068)
Browse files Browse the repository at this point in the history
* Fixes unknown option "--ansi" and "--no-ansi"

fixes #1066

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

---------

Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone authored Oct 16, 2023
1 parent 6a60371 commit 8b8144d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ jobs:
run: php artisan serve --no-reload &

- name: Run Dusk Tests
run: php artisan dusk --without-tty
run: php artisan dusk --without-tty --ansi
env:
APP_URL: http://127.0.0.1:8000
12 changes: 11 additions & 1 deletion src/Console/DuskCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,23 @@ 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 (version_compare(Version::id(), '10.0', '>=')) {
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 8b8144d

Please sign in to comment.