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

Beta support for Swift Testing, and other improvements. #867

Merged
merged 50 commits into from
Jul 8, 2024

Conversation

mbrandonw
Copy link
Member

@mbrandonw mbrandonw commented Jul 4, 2024

Opening this as a draft so that we can polish it up a bit more.

This PR brings beta support for Swift Testing, and greatly improves the two main customization points for snapshot testing: diffTool and isRecording. One can now fully customize how the diffTool produces a command for two file URLs, and isRecording has been turned into an enum with a 3rd option for never recording snapshots (useful for CI) and a forth option for recording only snapshots that fail (useful for strategies that use precision).

Resolves #840, #668, #508, #768, #862, #780, #531, #519

@mbrandonw mbrandonw merged commit dc6d151 into main Jul 8, 2024
3 checks passed
@mbrandonw mbrandonw deleted the swift-testing branch July 8, 2024 20:21
awaltzforvenus pushed a commit to oreillymedia/native-ios-swift-snapshot-testing that referenced this pull request Jul 30, 2024
)

* wip

* wip

* wip

* wip

* wip

* tests

* wip

* migration guide

* wip

* wip

* wip

* Update Sources/SnapshotTesting/AssertSnapshot.swift

* wip

* formatting

* wip

* format

* more

* wip

* fix

* Make record mode opaque.

* more docs

* wip

* wip

* Added new 'failed' record strategy, and wrote some tests.

* remove test artificats

* wip

* more docs

* fix linux tests

* more test fixes

* test clean up

* debugging

* debug

* wip

* fix

* fix tests

* wip

* wip

* wip

* make snapshot configuration optional

* make snapshot configuration optional

* clean up

* fix

* indent

* typo

* more clean up

* record before difftool

* more tests

* clean up test code

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
JustasL added a commit to vinted/swift-snapshot-testing that referenced this pull request Dec 11, 2024
* main: (27 commits)
  Run swift-format
  Fix assertSnapshot for Swift Testing tests. (pointfreeco#916)
  Add an NB to @_implementationOnly import.
  Run swift-format
  Import only the implementation of Testing. (pointfreeco#903)
  fix missing inline snapshot testing (pointfreeco#887)
  Feature/fixed decimal separator (pointfreeco#889)
  Run swift-format
  Xcode 16 beta 5: Fix snapshots test trait (pointfreeco#885)
  Run swift-format
  Don't invoke XCTContext when running in the Testing framework. (pointfreeco#884)
  Run swift-format
  Fixed .failed record mode in inline snapshots. (pointfreeco#874)
  Point updated packages to swiftlang organization (pointfreeco#873)
  Fix recordIssue for Xcode beta 3. (pointfreeco#869)
  Run swift-format
  Beta support for Swift Testing, and other improvements. (pointfreeco#867)
  Run swift-format
  New `canGenerateNewSnapshots` to avoid automatically creating missing ones in CI (pointfreeco#768)
  Run swift-format
  ...
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.

2 participants