Thread
#dagger
    a

    Ahmed Ibrahim

    2 years ago
    I have several test classes that are annotated by
    HiltAndroidTest
    and they have
    UninstallModules
    with the same set of modules to uninstall. If I add or remove an extra module to uninstall, I have to cascade the changes to the rest. Is there a way to avoid repeating myself with Hilt or do I need to file a feature request for that? What I tried and didn't work (inspired by Spring Boot TestComponent annotation)
    @UninstallModules(SearchModule::class, SearchResultsModule::class, DestinationsSearchModule::class)
    @HiltAndroidTest
    internal class MonthsFragmentTest
    Tried writing an annotation that combines them
    @UninstallModules(
        SearchModule::class,
        SearchResultsModule::class,
        DestinationsSearchModule::class
    )
    @kotlin.annotation.Target
    annotation class UninstallSearchProductionModules
    and tried replacing them
    @UninstallSearchProductionModules
    @HiltAndroidTest
    internal class MonthsFragmentTest
    a

    allan.conda

    2 years ago
    Yeah it’s a limitation for now, there’s an existing issue in GitHub if you try to find it
    a

    Ahmed Ibrahim

    2 years ago
    Thanks for pointing out. In case someone is interested to read the issue.https://github.com/google/dagger/issues/1923