chore: removes broken test

This commit is contained in:
Nuno Maduro
2023-06-17 20:52:19 +01:00
parent 8db3238a1f
commit 167c96965e
4 changed files with 1 additions and 91 deletions

View File

@ -1044,11 +1044,7 @@
✓ todo
✓ todo in parallel
PASS Tests\Visual\UnexpectedOutput
✓ unexpected output with ([''])
✓ unexpected output with (['--parallel'])
PASS Tests\Visual\Version
✓ visual snapshot of help command output
Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 8 todos, 18 skipped, 720 passed (1737 assertions)
Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 8 todos, 18 skipped, 718 passed (1735 assertions)

View File

@ -1,23 +0,0 @@
.this is unexpected output!
────────────────────────────────────────────────────────────────────────────
RISKY Tests\Fixtures\UnexpectedOutput > output
This test printed output: this is unexpected output
at src/Support/StateGenerator.php:58
54▕ foreach ($riskyEvents as $riskyEvent) {
55▕ $state->add(TestResult::fromPestParallelTestCase(
56▕ $riskyEvent->test(),
57▕ TestResult::RISKY,
➜ 58▕ ThrowableBuilder::from(new TestOutcome($riskyEvent->message()))
59▕ ));
60▕ }
61▕ }
62▕
1 src/Support/StateGenerator.php:58
+5 vendor frames
7 src/Plugins/Actions/CallsHandleArguments.php:29
Tests: 1 risky, 1 passed (2 assertions)

View File

@ -1,20 +0,0 @@
this is unexpected output
WARN Tests\Fixtures\UnexpectedOutput
! output → This test printed output: this is unexpected output
────────────────────────────────────────────────────────────────────────────
RISKY Tests\Fixtures\UnexpectedOutput > output
This test printed output: this is unexpected output
at src/Kernel.php:90
86▕ {
87▕ $args = CallsHandleArguments::execute($args);
88▕
89▕ try {
➜ 90▕ $this->application->run($args);
91▕ } catch (NoDirtyTestsFound) {
92▕ $this->output->writeln([
93▕ '',
94▕ ' INFO No tests found.',
Tests: 1 risky (1 assertions)

View File

@ -1,43 +0,0 @@
<?php
test('unexpected output', function (array $arguments) {
$snapshot = __DIR__.'/../.snapshots/unexpected-output.txt';
if (in_array('--parallel', $arguments)) {
$snapshot = __DIR__.'/../.snapshots/unexpected-output-parallel.txt';
}
$output = function () use ($arguments) {
$process = (new Symfony\Component\Process\Process(
array_merge(['php', 'bin/pest', 'tests/Fixtures/UnexpectedOutput.php'], $arguments),
null,
['COLLISION_PRINTER' => 'DefaultPrinter', 'COLLISION_IGNORE_DURATION' => 'true', 'COLLISION_TEST' => true]
));
$process->run();
return preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $process->getOutput());
};
if (getenv('REBUILD_SNAPSHOTS')) {
$outputContent = explode("\n", $output());
array_pop($outputContent);
array_pop($outputContent);
array_pop($outputContent);
if (in_array('--parallel', $arguments)) {
array_pop($outputContent);
array_pop($outputContent);
}
file_put_contents($snapshot, implode("\n", $outputContent));
$this->markTestSkipped('Snapshot rebuilt.');
}
expect($output())
->toContain(file_get_contents($snapshot));
})->with([
[['']],
[['--parallel']],
])->skipOnWindows();