TestSwrClientPlus
This extended interface of the SwrClientPlus provides the capability to mock specific queries, mutations, and subscriptions for the purpose of testing. By registering certain keys as mocks, you can control the behavior of these specific keys while the rest of the keys function normally. This allows for more targeted and precise testing of your application.
val cache = SwrCachePlus(..)
val testClient = cache.test {
on(MySubscriptionId) { MutableStateFlow("returned fake data") }
}
testClient.doSomething()
Properties
Functions
Suspends until the TestSwrClient is idle.
Mocks the query process corresponding to InfiniteQueryId.
Mocks the query process corresponding to InfiniteQueryTestTag.
Mocks the mutation process corresponding to MutationId.
Mocks the mutation process corresponding to MutationTestTag.
Mocks the query process corresponding to QueryId.
Mocks the query process corresponding to QueryTestTag.
Mocks the subscription process corresponding to SubscriptionId.
Mocks the subscription process corresponding to the given test tag.