From 00109e99767a770338c155b28346fd5842c915ca Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Wed, 2 Aug 2023 23:02:00 +0100 Subject: [PATCH] tests: adds more tests regarding snapshots multiple --- src/Concerns/Testable.php | 23 +++++++++++++++++++ src/Factories/TestCaseFactory.php | 22 ------------------ ...ple_snapshot_expectations_with_describe.snap | 1 + ..._snapshot_expectations_with_describe__2.snap | 1 + ...with_repeat_with_data_set___10____10_.snap | 1 + ...h_repeat_with_data_set___10____10___2.snap | 1 + ...s_with_repeat_with_data_set___1____1_.snap | 1 + ...ith_repeat_with_data_set___1____1___2.snap | 1 + ...s_with_repeat_with_data_set___2____2_.snap | 1 + ...ith_repeat_with_data_set___2____2___2.snap | 1 + ...s_with_repeat_with_data_set___3____3_.snap | 1 + ...ith_repeat_with_data_set___3____3___2.snap | 1 + ...s_with_repeat_with_data_set___4____4_.snap | 1 + ...ith_repeat_with_data_set___4____4___2.snap | 1 + ...s_with_repeat_with_data_set___5____5_.snap | 1 + ...ith_repeat_with_data_set___5____5___2.snap | 1 + ...s_with_repeat_with_data_set___6____6_.snap | 1 + ...ith_repeat_with_data_set___6____6___2.snap | 1 + ...s_with_repeat_with_data_set___7____7_.snap | 1 + ...ith_repeat_with_data_set___7____7___2.snap | 1 + ...s_with_repeat_with_data_set___8____8_.snap | 1 + ...ith_repeat_with_data_set___8____8___2.snap | 1 + ...s_with_repeat_with_data_set___9____9_.snap | 1 + ...ith_repeat_with_data_set___9____9___2.snap | 1 + ...isual_snapshot_of_help_command_output.snap | 2 +- ...isual_snapshot_of_help_command_output.snap | 2 +- tests/.snapshots/success.txt | 18 ++++++++++++++- tests/Features/Expect/toMatchSnapshot.php | 14 +++++++++++ tests/Visual/Parallel.php | 2 +- 29 files changed, 79 insertions(+), 26 deletions(-) create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/_describable__→_multiple_snapshot_expectations_with_describe.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/_describable__→_multiple_snapshot_expectations_with_describe__2.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___10____10_.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___10____10___2.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___1____1_.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___1____1___2.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___2____2_.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___2____2___2.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___3____3_.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___3____3___2.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___4____4_.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___4____4___2.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___5____5_.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___5____5___2.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___6____6_.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___6____6___2.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___7____7_.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___7____7___2.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___8____8_.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___8____8___2.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___9____9_.snap create mode 100644 tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___9____9___2.snap diff --git a/src/Concerns/Testable.php b/src/Concerns/Testable.php index 3268f2ae..e8d00588 100644 --- a/src/Concerns/Testable.php +++ b/src/Concerns/Testable.php @@ -62,6 +62,11 @@ trait Testable */ private static ?Closure $__afterAll = null; + /** + * The list of snapshot changes, if any. + */ + private array $__snapshotChanges = []; + /** * Resets the test case static properties. */ @@ -331,6 +336,24 @@ trait Testable return ExceptionTrace::ensure(fn (): mixed => call_user_func_array(Closure::bind($closure, $this, $this::class), $arguments)); } + /** @postCondition */ + protected function __MarkTestIncompleteIfSnapshotHaveChanged(): void + { + if (count($this->__snapshotChanges) === 0) { + return; + } + + if (count($this->__snapshotChanges) === 1) { + $this->markTestIncomplete($this->__snapshotChanges[0]); + + return; + } + + $messages = implode(PHP_EOL, array_map(static fn (string $message): string => '- $message', $this->__snapshotChanges)); + + $this->markTestIncomplete($messages); + } + /** * The printable test case name. */ diff --git a/src/Factories/TestCaseFactory.php b/src/Factories/TestCaseFactory.php index 7b9da1f9..cbe50985 100644 --- a/src/Factories/TestCaseFactory.php +++ b/src/Factories/TestCaseFactory.php @@ -189,29 +189,7 @@ final class TestCaseFactory private static \$__filename = '$filename'; - private array \$__snapshotChanges = []; - $methodsCode - - /** @postCondition */ - protected function __MarkTestIncompleteIfSnapshotHaveChanged(): void - { - if (empty(\$this->__snapshotChanges)) { - return; - } - - if (count(\$this->__snapshotChanges) === 1) { - \$this->markTestIncomplete(\$this->__snapshotChanges[0]); - - return; - } - - \$formattedMessages = implode(PHP_EOL, array_map(function (string \$message) { - return "- \$message"; - }, \$this->__snapshotChanges)); - - \$this->markTestIncomplete(\$formattedMessages); - } } PHP; diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/_describable__→_multiple_snapshot_expectations_with_describe.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/_describable__→_multiple_snapshot_expectations_with_describe.snap new file mode 100644 index 00000000..7b5a8676 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/_describable__→_multiple_snapshot_expectations_with_describe.snap @@ -0,0 +1 @@ +foo bar 1 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/_describable__→_multiple_snapshot_expectations_with_describe__2.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/_describable__→_multiple_snapshot_expectations_with_describe__2.snap new file mode 100644 index 00000000..206d0d02 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/_describable__→_multiple_snapshot_expectations_with_describe__2.snap @@ -0,0 +1 @@ +foo bar 2 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___10____10_.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___10____10_.snap new file mode 100644 index 00000000..7b5a8676 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___10____10_.snap @@ -0,0 +1 @@ +foo bar 1 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___10____10___2.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___10____10___2.snap new file mode 100644 index 00000000..206d0d02 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___10____10___2.snap @@ -0,0 +1 @@ +foo bar 2 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___1____1_.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___1____1_.snap new file mode 100644 index 00000000..7b5a8676 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___1____1_.snap @@ -0,0 +1 @@ +foo bar 1 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___1____1___2.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___1____1___2.snap new file mode 100644 index 00000000..206d0d02 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___1____1___2.snap @@ -0,0 +1 @@ +foo bar 2 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___2____2_.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___2____2_.snap new file mode 100644 index 00000000..7b5a8676 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___2____2_.snap @@ -0,0 +1 @@ +foo bar 1 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___2____2___2.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___2____2___2.snap new file mode 100644 index 00000000..206d0d02 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___2____2___2.snap @@ -0,0 +1 @@ +foo bar 2 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___3____3_.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___3____3_.snap new file mode 100644 index 00000000..7b5a8676 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___3____3_.snap @@ -0,0 +1 @@ +foo bar 1 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___3____3___2.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___3____3___2.snap new file mode 100644 index 00000000..206d0d02 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___3____3___2.snap @@ -0,0 +1 @@ +foo bar 2 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___4____4_.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___4____4_.snap new file mode 100644 index 00000000..7b5a8676 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___4____4_.snap @@ -0,0 +1 @@ +foo bar 1 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___4____4___2.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___4____4___2.snap new file mode 100644 index 00000000..206d0d02 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___4____4___2.snap @@ -0,0 +1 @@ +foo bar 2 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___5____5_.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___5____5_.snap new file mode 100644 index 00000000..7b5a8676 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___5____5_.snap @@ -0,0 +1 @@ +foo bar 1 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___5____5___2.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___5____5___2.snap new file mode 100644 index 00000000..206d0d02 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___5____5___2.snap @@ -0,0 +1 @@ +foo bar 2 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___6____6_.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___6____6_.snap new file mode 100644 index 00000000..7b5a8676 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___6____6_.snap @@ -0,0 +1 @@ +foo bar 1 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___6____6___2.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___6____6___2.snap new file mode 100644 index 00000000..206d0d02 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___6____6___2.snap @@ -0,0 +1 @@ +foo bar 2 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___7____7_.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___7____7_.snap new file mode 100644 index 00000000..7b5a8676 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___7____7_.snap @@ -0,0 +1 @@ +foo bar 1 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___7____7___2.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___7____7___2.snap new file mode 100644 index 00000000..206d0d02 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___7____7___2.snap @@ -0,0 +1 @@ +foo bar 2 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___8____8_.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___8____8_.snap new file mode 100644 index 00000000..7b5a8676 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___8____8_.snap @@ -0,0 +1 @@ +foo bar 1 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___8____8___2.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___8____8___2.snap new file mode 100644 index 00000000..206d0d02 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___8____8___2.snap @@ -0,0 +1 @@ +foo bar 2 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___9____9_.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___9____9_.snap new file mode 100644 index 00000000..7b5a8676 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___9____9_.snap @@ -0,0 +1 @@ +foo bar 1 \ No newline at end of file diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___9____9___2.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___9____9___2.snap new file mode 100644 index 00000000..206d0d02 --- /dev/null +++ b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/multiple_snapshot_expectations_with_repeat_with_data_set___9____9___2.snap @@ -0,0 +1 @@ +foo bar 2 \ No newline at end of file diff --git a/tests/.pest/snapshots/Visual/Help/visual_snapshot_of_help_command_output.snap b/tests/.pest/snapshots/Visual/Help/visual_snapshot_of_help_command_output.snap index c630e2d5..2a53ae8f 100644 --- a/tests/.pest/snapshots/Visual/Help/visual_snapshot_of_help_command_output.snap +++ b/tests/.pest/snapshots/Visual/Help/visual_snapshot_of_help_command_output.snap @@ -1,5 +1,5 @@ - Pest Testing Framework 2.11.0. + Pest Testing Framework 2.12.0. USAGE: pest [options] diff --git a/tests/.pest/snapshots/Visual/Version/visual_snapshot_of_help_command_output.snap b/tests/.pest/snapshots/Visual/Version/visual_snapshot_of_help_command_output.snap index 30e2d8c5..c6d73125 100644 --- a/tests/.pest/snapshots/Visual/Version/visual_snapshot_of_help_command_output.snap +++ b/tests/.pest/snapshots/Visual/Version/visual_snapshot_of_help_command_output.snap @@ -1,3 +1,3 @@ - Pest Testing Framework 2.11.0. + Pest Testing Framework 2.12.0. diff --git a/tests/.snapshots/success.txt b/tests/.snapshots/success.txt index f9d7233c..f9b5bcd1 100644 --- a/tests/.snapshots/success.txt +++ b/tests/.snapshots/success.txt @@ -698,6 +698,22 @@ ✓ failures ✓ failures with custom message ✓ not failures + ✓ multiple snapshot expectations + ✓ multiple snapshot expectations with datasets with (1) + ✓ multiple snapshot expectations with datasets with ('foo') + ✓ multiple snapshot expectations with datasets with ('bar') + ✓ multiple snapshot expectations with datasets with ('baz') + ✓ describable → multiple snapshot expectations with describe + ✓ multiple snapshot expectations with repeat @ repetition 1 of 10 + ✓ multiple snapshot expectations with repeat @ repetition 2 of 10 + ✓ multiple snapshot expectations with repeat @ repetition 3 of 10 + ✓ multiple snapshot expectations with repeat @ repetition 4 of 10 + ✓ multiple snapshot expectations with repeat @ repetition 5 of 10 + ✓ multiple snapshot expectations with repeat @ repetition 6 of 10 + ✓ multiple snapshot expectations with repeat @ repetition 7 of 10 + ✓ multiple snapshot expectations with repeat @ repetition 8 of 10 + ✓ multiple snapshot expectations with repeat @ repetition 9 of 10 + ✓ multiple snapshot expectations with repeat @ repetition 10 of 10 PASS Tests\Features\Expect\toStartWith ✓ pass @@ -1194,4 +1210,4 @@ WARN Tests\Visual\Version - visual snapshot of help command output - Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 19 skipped, 844 passed (1947 assertions) \ No newline at end of file + Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 19 skipped, 860 passed (1979 assertions) \ No newline at end of file diff --git a/tests/Features/Expect/toMatchSnapshot.php b/tests/Features/Expect/toMatchSnapshot.php index 86320e38..2ca6467f 100644 --- a/tests/Features/Expect/toMatchSnapshot.php +++ b/tests/Features/Expect/toMatchSnapshot.php @@ -132,3 +132,17 @@ test('multiple snapshot expectations with datasets', function () { expect('foo bar 2')->toMatchSnapshot(); })->with([1, 'foo', 'bar', 'baz']); + +describe('describable', function () { + test('multiple snapshot expectations with describe', function () { + expect('foo bar 1')->toMatchSnapshot(); + + expect('foo bar 2')->toMatchSnapshot(); + }); +}); + +test('multiple snapshot expectations with repeat', function () { + expect('foo bar 1')->toMatchSnapshot(); + + expect('foo bar 2')->toMatchSnapshot(); +})->repeat(10); diff --git a/tests/Visual/Parallel.php b/tests/Visual/Parallel.php index 406c0f5b..d2d90895 100644 --- a/tests/Visual/Parallel.php +++ b/tests/Visual/Parallel.php @@ -16,7 +16,7 @@ $run = function () { test('parallel', function () use ($run) { expect($run('--exclude-group=integration')) - ->toContain('Tests: 1 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 15 skipped, 833 passed (1932 assertions)') + ->toContain('Tests: 1 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 15 skipped, 849 passed (1964 assertions)') ->toContain('Parallel: 3 processes'); })->skipOnWindows();