I am migrating my app to androidx, I can\'t seem to get my unit tests working. I took example from Google\'s AndroidJunitRunnerSample, which has been updated to use the new
As for my case, defining a function parameter was the problem.
@Test
fun foo(string: String = "") { // Causes "Delegate runner could not be loaded" error.
// ...
}
I had to do something like the following.
@Test
fun foo() {
foo("")
}
fun foo(string: String) { // Can be called from other test functions.
// ...
}