Skip to content
Discussion options

You must be logged in to vote

Hey @joelCHonor, did you see the "non-exhaustive" test store feature that was released recently? It allows you to opt out of exhaustivity for a particular test:

let store = TestStore(...)
store.exhaustivity = .off(showSkippedAssertions: true)

store.send(.tap) {
  $0.count = 1
  // No need to assert on fields that were changed randomly
}

Alternatively, you could control your dependency on randomness. You could have a @Dependency(\.random) in your feature that in tests just returns a constant value.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@joelCHonor
Comment options

@stephencelis
Comment options

Answer selected by joelCHonor
Comment options

You must be logged in to vote
4 replies
@mbrandonw
Comment options

@joelCHonor
Comment options

@mbrandonw
Comment options

@joelCHonor
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants