//Extensions for Dagger Hilt/it.czerwinski.android.hilt.fragment.testing/HiltFragmentScenario/onFragment

onFragment

[androidJvm]
Content
fun onFragment(action: HiltFragmentScenario.FragmentAction<F>): HiltFragmentScenario<F, A>
More info

Runs a given action on the current Activity’s main thread.

Note that you should never keep Fragment reference passed into your action because it can be recreated at anytime during state transitions.

Throwing an exception from action makes the host Activity crash. You can inspect the exception in logcat outputs.

This method cannot be called from the main thread.