diff --git a/src/Actions/AddsDefaults.php b/src/Actions/AddsDefaults.php index 951a1e46..799eda6e 100644 --- a/src/Actions/AddsDefaults.php +++ b/src/Actions/AddsDefaults.php @@ -21,7 +21,7 @@ final class AddsDefaults public static function to(array $arguments): array { if (!array_key_exists('printer', $arguments)) { - $arguments['printer'] = new Printer(); + $arguments['printer'] = new Printer(null, $arguments['verbose'] ?? false, $arguments['colors'] ?? 'always'); } return $arguments; diff --git a/tests/.snapshots/success.txt b/tests/.snapshots/success.txt index 25f4531a..4509aee3 100644 --- a/tests/.snapshots/success.txt +++ b/tests/.snapshots/success.txt @@ -124,9 +124,11 @@ PASS Tests\Visual\SingleTestOrDirectory ✓ allows to run a single test ✓ allows to run a directory + ✓ it has ascii chars (decorated printer) + ✓ it disable decorating printer when colors is set to never WARN Tests\Visual\Success s visual snapshot of test suite on success - Tests: 6 skipped, 67 passed - Time: 2.67s + Tests: 6 skipped, 69 passed + Time: 2.34s diff --git a/tests/Visual/SingleTestOrDirectory.php b/tests/Visual/SingleTestOrDirectory.php index 6dd9204b..d7a42e0a 100644 --- a/tests/Visual/SingleTestOrDirectory.php +++ b/tests/Visual/SingleTestOrDirectory.php @@ -30,3 +30,37 @@ test('allows to run a directory', function () use ($run) { Tests: 2 passed EOF, $run('tests/Fixtures')); }); + +it('has ascii chars (decorated printer)', function () { + $process = new Process([ + './bin/pest', + 'tests/Fixtures/DirectoryWithTests/ExampleTest.php', + ], dirname(__DIR__, 2)); + + $process->run(); + $output = $process->getOutput(); + assertStringContainsString(<<run(); + $output = $process->getOutput(); + + assertStringContainsString(<<