fix: don't decorate output if --colors=never is set

This commit is contained in:
Owen Voke
2020-08-19 13:36:41 +01:00
parent 57a1ccd213
commit 36b879f97d

View File

@ -6,6 +6,7 @@ use Pest\Actions\ValidatesEnvironment;
use Pest\Console\Command; use Pest\Console\Command;
use Pest\Support\Container; use Pest\Support\Container;
use Pest\TestSuite; use Pest\TestSuite;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
@ -27,7 +28,9 @@ use Symfony\Component\Console\Output\OutputInterface;
$rootPath = getcwd(); $rootPath = getcwd();
$testSuite = TestSuite::getInstance($rootPath); $testSuite = TestSuite::getInstance($rootPath);
$output = new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, true);
$isDecorated = (new ArgvInput())->getParameterOption('--colors', 'always') !== 'never';
$output = new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, $isDecorated);
$container = Container::getInstance(); $container = Container::getInstance();
$container->add(TestSuite::class, $testSuite); $container->add(TestSuite::class, $testSuite);