-
Notifications
You must be signed in to change notification settings - Fork 47
[WorkflowTests] Support assertions which throw #92
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
[WorkflowTests] Support assertions which throw #92
Conversation
import XCTest | ||
|
||
extension WorkflowAction { | ||
public extension WorkflowAction { |
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.
These access control declaration updates were performed by SwiftFormat.
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.
Hmmmm. I'd rather the access control declarations live on the functions themselves (so we don't accidentally expose something that wasn't meant to be exposed). I wonder if there's a SwiftFormat flag we can change.
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.
Yeah, we haven't pinned SwiftFormat to an exact version. I guess the newer version's doing this automatically.
I'll fix.
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.
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.
Happy to do so!
.verifyState { XCTAssertTrue($0) } | ||
} | ||
|
||
func test_stateTransitions_throw() throws { |
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.
This tests and those that follow are demonstrative of the testing style these changes support, and serve to ensure we continue to support this testing style.
If others find them unnecessary, I'm happy to remove them.
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.
I think this is fine. I don't think it's strictly necessary — it's more of a "ensure the code doesn't change" test than a unit test, but this will help prevent unintended breakages.
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.
Thanks for taking this on, Noah!
import XCTest | ||
|
||
extension WorkflowAction { | ||
public extension WorkflowAction { |
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.
Hmmmm. I'd rather the access control declarations live on the functions themselves (so we don't accidentally expose something that wasn't meant to be exposed). I wonder if there's a SwiftFormat flag we can change.
.verifyState { XCTAssertTrue($0) } | ||
} | ||
|
||
func test_stateTransitions_throw() throws { |
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.
I think this is fine. I don't think it's strictly necessary — it's more of a "ensure the code doesn't change" test than a unit test, but this will help prevent unintended breakages.
608c8af
to
142bec8
Compare
Summary
This PR makes allowances for throwing assertions in
ActionTester.verify
andRenderTester.render
. These changes are meant to support tests which take advantage of XCTest's expanding API for test cases which throw.Example of the impact of this change:
Old:
New:
Checklist