From 28d06663d314f2104cdcfe3b25c4272c75747fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jib=C3=A9=20Barth?= Date: Sun, 31 May 2020 12:33:27 +0200 Subject: [PATCH] Add tests for --colors=never option --- tests/.snapshots/success.txt | 6 +++-- tests/Visual/SingleTestOrDirectory.php | 34 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) 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(<<