TestSwrClient
This extended interface of the SwrClient provides the capability to mock specific queries and mutations 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 = SwrCache(..)
val testClient = client.test {
on(MyQueryId) { "returned fake data" }
}
testClient.doSomething()
Content copied to clipboard
Inheritors
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
Mocks the query process corresponding to InfiniteQueryId.
Mocks the mutation process corresponding to MutationId.
Mocks the query process corresponding to QueryId.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Switches SwrClient to a test interface.