Replies: 2 comments
-
I usually do the following: var didCallSetString = false
testStore.dependencies.userDefaultsClient.setString = { _, _ in
didCallSetString = true
}
await testStore.send(.onAppear) {
...
}
XCTAssertTrue(didCallSetString) Without using timeout. |
Beta Was this translation helpful? Give feedback.
0 replies
-
You should look into ActorIsolated. There's an example in the docs. about how to use it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
what do you all think about adding implicit
XCTestExpectation
when we manually override dependency endpoint inTestStore
? I don't have any solutions ready for this, since its just an Idea I had, when testingVoid
returning Clients.If I am not wrong, now the only way to prove that a dependency was called, we have to add Expectations manually like this
I am thinking about some naive way where I can just state that this dependency is implemented using current syntax (possibly enhanced with a timeout value), and TCA would force me to call it when exhaustive testing is turned on. Like it does when this endpoint is called, but I did not provide it, it fails the tests, when using
XCTUnimplemented
Beta Was this translation helpful? Give feedback.
All reactions