2

How can I write a unit test for Stateflow in the ViewModel

Stateflow in ViewModel:

private fun fetchLocation() {

    viewModelScope.launch {

       interactions.getLocation.invoke().collect {
            locationFlow.value = it
        }
    }
}

val getLocation: StateFlow<String?> = locationFlow
General Grievance
  • 4,555
  • 31
  • 31
  • 45
Saeed Noshadi
  • 829
  • 12
  • 34

0 Answers0