remove duration from success snapshot

This commit is contained in:
Fabio Ivona
2022-09-19 08:55:45 +02:00
parent c5cb1fc325
commit 7bc513bc2b
2 changed files with 6 additions and 4 deletions

View File

@ -767,4 +767,4 @@
PASS Tests\Visual\Version
✓ visual snapshot of help command output
Tests: 4 incomplete, 1 todo, 18 skipped, 511 passed (1286 assertions)
Tests: 4 incomplete, 1 todo, 18 skipped, 511 passed (1286 assertions)

View File

@ -27,10 +27,12 @@ test('visual snapshot of test suite on success', function () {
};
if (getenv('REBUILD_SNAPSHOTS')) {
// Strip time from end of snapshot
$outputContent = preg_replace('/Time\: \s+\d+\.\d+s\s+/m', '', $output());
$outputContent = explode("\n", $output());
array_pop($outputContent);
array_pop($outputContent);
array_pop($outputContent);
file_put_contents($snapshot, $outputContent);
file_put_contents($snapshot, implode("\n", $outputContent));
} elseif (! getenv('EXCLUDE')) {
$output = explode("\n", $output());
array_pop($output);