Swap ViewModel during testing in Android via Hilt
I have seen a lot of Hilt examples where we hard code the actual implementation of ViewModel in the Activity or Fragment. May be, this is what you need, and you want to test your Fragments or Activities with the actual ViewModel. But if you are…