Adjusts tests to new printer

This commit is contained in:
Nuno Maduro
2022-09-15 20:54:46 +01:00
parent 797ebb2986
commit bee4eda3ef
11 changed files with 41 additions and 29 deletions

View File

@ -4,4 +4,4 @@
PASS Tests\Fixtures\ExampleTest
✓ it example 2
Tests: 2 passed
Tests: 2 passed (2 assertions)

View File

@ -1,4 +1,4 @@
PASS Tests\Fixtures\DirectoryWithTests\ExampleTest
✓ it example 1
Tests: 1 passed
Tests: 1 passed (1 assertions)

View File

@ -1,5 +1,5 @@
PASS Tests\Fixtures\DirectoryWithTests\ExampleTest
it example 1
✓ it example 1
Tests: 1 passed
Tests: 1 passed (1 assertions)

View File

@ -1,5 +1,4 @@
 PASS  Tests\Fixtures\DirectoryWithTests\ExampleTest
✓ it example 1
✓ it example 1
Tests: 1 passed
Tests: 1 passed (1 assertions)

View File

@ -482,8 +482,8 @@
✓ not failures with nested key
✓ not failures with plain key with dots
✓ not failures with correct value
✓ not failures with correct value and with nested key
✓ not failures with correct value and with plain key with dots
✓ not failures with correct value and with nested key
✓ not failures with correct value and with plain key with dots
PASS Tests\Features\Expect\toHaveKeys
✓ pass
@ -614,8 +614,8 @@
PASS Tests\Features\PendingHigherOrderTests
✓ get 'foo'
✓ get 'foo' → get 'bar' → expect true → toBeTrue
✓ get 'foo' → expect true → toBeTrue
✓ get 'foo' → get 'bar' → expect true → toBeTrue
✓ get 'foo' → expect true → toBeTrue
WARN Tests\Features\Skip
✓ it do not skips
@ -770,5 +770,4 @@
WARN Tests\Visual\TeamCity
- it is can successfully call all public methods → Not supported yet.
Tests: 4 incompleted, 18 skipped, 515 passed
Tests: 4 incompleted, 18 skipped, 515 passed (1299 assertions)

View File

@ -16,7 +16,7 @@ test('visual snapshot of help command output', function () {
}
$output = function () {
$process = (new Symfony\Component\Process\Process(['php', 'bin/pest', '--help']));
$process = (new Symfony\Component\Process\Process(['php', 'bin/pest', '--help'], null, ['COLLISION_PRINTER' => 'DefaultPrinter', 'COLLISION_IGNORE_DURATION' => 'true']));
$process->run();

View File

@ -3,7 +3,9 @@
use Symfony\Component\Process\Process;
$run = function (string $target, $decorated = false) {
$process = new Process(['php', 'bin/pest', $target, '--colors=always'], dirname(__DIR__, 2));
$process = new Process(['php', 'bin/pest', $target, '--colors=always'], dirname(__DIR__, 2),
['COLLISION_PRINTER' => 'DefaultPrinter', 'COLLISION_IGNORE_DURATION' => 'true'],
);
$process->run();
@ -29,6 +31,7 @@ test('allows to run a directory', function () use ($run, $snapshot) {
})->skip(PHP_OS_FAMILY === 'Windows');
it('has ascii chars', function () use ($run, $snapshot) {
file_put_contents(__DIR__.'/output.txt', $run('tests/Fixtures/DirectoryWithTests/ExampleTest.php', true));
expect($run('tests/Fixtures/DirectoryWithTests/ExampleTest.php', true))->toContain($snapshot('has-ascii-chars'));
})->skip(PHP_OS_FAMILY === 'Windows');
@ -38,7 +41,7 @@ it('disable decorating printer when colors is set to never', function () use ($s
'./bin/pest',
'--colors=never',
'tests/Fixtures/DirectoryWithTests/ExampleTest.php',
], dirname(__DIR__, 2));
], dirname(__DIR__, 2), ['COLLISION_PRINTER' => 'DefaultPrinter', 'COLLISION_IGNORE_DURATION' => 'true']);
$process->run();
$output = $process->getOutput();
expect($output)->toContain($snapshot('disable-decorating-printer'));

View File

@ -12,7 +12,7 @@ test('visual snapshot of test suite on success', function () {
$process = (new Symfony\Component\Process\Process(
['php', 'bin/pest'],
dirname($testsPath),
['EXCLUDE' => 'integration', 'REBUILD_SNAPSHOTS' => false, 'PARATEST' => 0, 'COLLISION_PRINTER' => 'DefaultPrinter'],
['EXCLUDE' => 'integration', 'REBUILD_SNAPSHOTS' => false, 'PARATEST' => 0, 'COLLISION_PRINTER' => 'DefaultPrinter', 'COLLISION_IGNORE_DURATION' => 'true'],
));
$process->run();