Skip to content
Discussion options

You must be logged in to vote

Hi @Paul-Svetlichny, I don't think you are using the library wrong or misunderstanding how things should be structured. While it is true that TCA's testing tools like you to exhaustively prove everything about the feature, including that all effects finish, sometimes that isn't possible. If you truly have an effect that lives for the entire duration of the app, then there is no user action that causes the effect to stop (other than force-quitting the app).

So, you have two choices:

  • You can actually get a handle on the task that represents the lifetime of the effect in the test, and then cancel it once your test is complete:

    let task = store.send(.appDidLaunch)
    
    await task.cancel() // A…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Paul-Svetlichny
Comment options

Answer selected by Paul-Svetlichny
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants