Skip to content

Instantly share code, notes, and snippets.

@ferPrieto
Created January 4, 2022 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ferPrieto/7da66466b106d7322f1799808380b03a to your computer and use it in GitHub Desktop.
Save ferPrieto/7da66466b106d7322f1799808380b03a to your computer and use it in GitHub Desktop.
This is the FakeNetworkModule class used for testing purpose that replaces the original one (NetworkModule) defined in production
@Module
@TestInstallIn(
components = [SingletonComponent::class],
replaces = [NetworkModule::class]
)
class FakeNetworkModule : NetworkModule() {
override fun getBaseUrl() = "http://127.0.0.1:${BuildConfig.PORT}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment