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 client = SwrCachePlus(..)
val testClient = client.testPlus {
on(MySubscriptionId) { MutableStateFlow("returned fake data") }
}
testClient.doSomething()
Content copied to clipboard
Properties
Functions
Link copied to clipboard
Link copied to clipboard
abstract fun <T, S> getInfiniteQuery(key: InfiniteQueryKey<T, S>, marker: Marker): InfiniteQueryRef<T, S>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Mocks the query process corresponding to InfiniteQueryId.
Mocks the mutation process corresponding to MutationId.
Mocks the query process corresponding to QueryId.
Mocks the subscription process corresponding to SubscriptionId.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Switches SwrClient to a test interface.
Link copied to clipboard
Switches SwrClientPlus to a test interface.