waitForLiveData

fun <T> LiveData<T>.waitForLiveData(timeoutMs: Long = DEFAULT_WAIT_LIVE_DATA_TIMEOUT_MS, predicate: (T) -> Boolean): Boolean

Wait for the LiveData instance to have a given predicate.

The predicate is invoked for each value set to the LiveData instance on the main thread.

Can be called from the test thread. Can not be called on the main thread.