Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.x] Multiple snapshots #881

Merged
merged 10 commits into from
Aug 2, 2023
Merged

[2.x] Multiple snapshots #881

merged 10 commits into from
Aug 2, 2023

Conversation

fabio-ivona
Copy link
Collaborator

@fabio-ivona fabio-ivona commented Jul 27, 2023

This PR will

  • Cleanup SnapshotRepository code, as TestCase is retrieved inside the repository
  • Implement a snapshot expectations counter to keep track of multiple snapshots in the same test

note found an issue: when the first snapshot is created, a $testCase::markTestIncomplete() is called inside toMatchSnapshot expectation (Mixin/Expectation.php L837). This will stop the execution and prevent the creation of the second snapshot.

I commented out that line for now, resulting in a plain Risky test instead of an Incomplete one. Any idea on how to workaround on this?

@fabio-ivona fabio-ivona requested a review from nunomaduro July 27, 2023 09:51
@fabio-ivona fabio-ivona linked an issue Jul 27, 2023 that may be closed by this pull request
@fabio-ivona fabio-ivona marked this pull request as draft August 1, 2023 14:39
# Conflicts:
#	src/Expectation.php
#	src/Expectations/OppositeExpectation.php
@fabio-ivona fabio-ivona marked this pull request as ready for review August 1, 2023 15:15
@nunomaduro nunomaduro merged commit 546253d into pestphp:2.x Aug 2, 2023
@fabio-ivona fabio-ivona deleted the snaphsots-cleanup branch August 3, 2023 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

toMatchSnapshot only supports one snapshot per test
2 participants