-
Notifications
You must be signed in to change notification settings - Fork 6
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
Swift Testing Implementation #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Ethan! Thanks a ton for taking a stab at this. It looks really good. I left a handful of comments for tidying things up. Can't wait to get this merged!
Edit: I'm also curious if there's opportunity here to reshape the expectation API by utilizing Combine Publisher's value
parameter, which returns an async sequence of elements from the publisher. The reason I didn't do this originally is because I didn't have a timeout mechanism. Now that we do, assuming that ["cool"].publisher.value
supports cooperative cancellation, we may be able to reshape the expectation code.
Regardless, I think we can explore that later as part of a new major version. You're on the right track here with this PR.
Sources/SwiftTestingTestableCombinePublishers/SwiftTestingExpectation.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftTestingTestableCombinePublishers/SwiftTestingPublisherExpectation.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftTestingTestableCombinePublishers/SwiftTestingPublisherExpectation.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftTestingTestableCombinePublishers/SwiftTestingPublisherExpectation.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftTestingTestableCombinePublishers/SwiftTestingPublisherExpectation.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftTestingTestableCombinePublishers/SwiftTestingPublisherExpectation.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftTestingTestableCombinePublishers/SwiftTestingPublisherExpectation.swift
Show resolved
Hide resolved
.../SwiftTestingTestableCombinePublishersTests/SwiftTestingTestableCombinePublishersTests.swift
Outdated
Show resolved
Hide resolved
.../SwiftTestingTestableCombinePublishersTests/SwiftTestingTestableCombinePublishersTests.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftTestingTestableCombinePublishers/SwiftTestingPublisherExpectation.swift
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Fantastic work!
This PR introduces a Swift Testing-based solution for
TestableCombinePublishers
.SwiftTestingTestableCombinePublishers
target which mimics the existingTestableCombinePublishers
target, but with no usage of the XCTest library.TestableCombinePublishersUtility
target which houses shared logic between the XCTest and Swift Testing implementations - i.e.AutomaticallyEquatable
The only different between the XCTest and Swift Testing implementation is that the Swift Testing implementation utilizes
async/await
:TestableCombinePublishers
SwiftTestingTestableCombinePublishers