Skip to content

Instantly share code, notes, and snippets.

@jobinlawrance
Last active December 13, 2020 21:06
Show Gist options
  • Save jobinlawrance/024d2bcc57d6c2dde3f13dc27f918098 to your computer and use it in GitHub Desktop.
Save jobinlawrance/024d2bcc57d6c2dde3f13dc27f918098 to your computer and use it in GitHub Desktop.
...
android {
...
defaultConfig {
...
testInstrumentationRunner "com.jobinlawrance.appname.MockTestRunner"
}
}
...
open class MockTestRunner : AndroidJUnitRunner() {
override fun onCreate(arguments: Bundle?) {
StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder().permitAll().build())
super.onCreate(arguments)
}
override fun newApplication(cl: ClassLoader?, className: String?, context: Context?): Application {
return super.newApplication(cl, TestHomeApplication::class.java.name, context)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment