Skip to content

Commit 8b8144d

Browse files
authored
Fixes unknown option "--ansi" and "--no-ansi" (#1068)
* 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]>
1 parent 6a60371 commit 8b8144d

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,6 @@ jobs:
104104
run: php artisan serve --no-reload &
105105

106106
- name: Run Dusk Tests
107-
run: php artisan dusk --without-tty
107+
run: php artisan dusk --without-tty --ansi
108108
env:
109109
APP_URL: http://127.0.0.1:8000

src/Console/DuskCommand.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,23 @@ protected function phpunitArguments($options)
125125
}
126126

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

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

135+
if (version_compare(Version::id(), '10.0', '>=')) {
136+
if ($this->option('ansi')) {
137+
$options[] = '--colors=always';
138+
}
139+
140+
if ($this->option('no-ansi')) {
141+
$options[] = '--colors=never';
142+
}
143+
}
144+
135145
return array_merge(['-c', $file], $options);
136146
}
137147

0 commit comments

Comments
 (0)