From 7bc513bc2bbc766ff097175cdd586aa9aeb1d047 Mon Sep 17 00:00:00 2001 From: Fabio Ivona Date: Mon, 19 Sep 2022 08:55:45 +0200 Subject: [PATCH] remove duration from success snapshot --- tests/.snapshots/success.txt | 2 +- tests/Visual/Success.php | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/.snapshots/success.txt b/tests/.snapshots/success.txt index fa371749..a65cea91 100644 --- a/tests/.snapshots/success.txt +++ b/tests/.snapshots/success.txt @@ -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) \ No newline at end of file diff --git a/tests/Visual/Success.php b/tests/Visual/Success.php index d8928552..41cbcdce 100644 --- a/tests/Visual/Success.php +++ b/tests/Visual/Success.php @@ -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);