From 61b2c426e447fa485011c8eadb6c26e4c1b068e0 Mon Sep 17 00:00:00 2001 From: Owen Voke Date: Mon, 24 Aug 2020 21:29:56 +0100 Subject: [PATCH] fix: update snapshot generation to strip time --- tests/.snapshots/success.txt | 1 + tests/Visual/Success.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/.snapshots/success.txt b/tests/.snapshots/success.txt index a0769abf..240e75f9 100644 --- a/tests/.snapshots/success.txt +++ b/tests/.snapshots/success.txt @@ -353,3 +353,4 @@ ✓ depends run test only once Tests: 6 skipped, 207 passed + \ No newline at end of file diff --git a/tests/Visual/Success.php b/tests/Visual/Success.php index 609f5b19..1323da5b 100644 --- a/tests/Visual/Success.php +++ b/tests/Visual/Success.php @@ -17,7 +17,10 @@ test('visual snapshot of test suite on success', function () { }; if (getenv('REBUILD_SNAPSHOTS')) { - file_put_contents($snapshot, $output()); + // Strip time from end of snapshot + $outputContent = preg_replace('/Time\: \s+\d+\.\d+s\s+/m', '', $output()); + + file_put_contents($snapshot, $outputContent); } elseif (!getenv('EXCLUDE')) { $output = explode("\n", $output()); array_pop($output);