Replies: 1 comment 1 reply
-
This is the way to go for now. While it's definitely annoying to have to remember to check, remember that this is basically how every test is written outside of TCA 😄 We'd be open to explore extending the exhaustive testing tools to readers, but we're not sure how that would look since readers aren't mutable: await store.send(.sortButtonTapped) {
// Syntax already exists and is what you write in the app code as well
$0.$sortAscending.withLock { $0 = true }
// What possible syntax could we use to make an exhaustive assertion here?
$0.$items.???
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Have there been any best practices shared on testing TCA features that use dynamic shared keys? Here's an example:
When I run code like this I get a passing test even though I haven't mentioned anything about the change to
items
. Just for fun, I can even throw in a "wrong" assignment in there:This still passes. Of course, I can throw in an explicit check after the send and get test coverage for the change, but now I have to remember that each time.
Any tips on a better approach to this kind of thing?
Beta Was this translation helpful? Give feedback.
All reactions