:android-wave: Hi folks My app has this scenario ...
# dagger
p
👋 Hi folks My app has this scenario From workmanager's worker class I update a Singleton EventBus and my HomeViewModel listens to it and shows a UI modal UI Testing scenarios like this when using
EarlyEntryPoints
is not possible As Worker class dependencies uses a different graph of objects and doesn't share any state with Singleton graph Any workarounds to test cases like this? https://dagger.dev/hilt/early-entry-point
I have created a sample app to reproduce this. https://github.com/prudhvir3ddy/earlyentrypoint-sample/
Found the solution to this. You can use workmanager-testing library to initialise your workmanager with the HiltWorkerFactory and uninstall your workmanager module , And don't use
EarlyEntryPoints
for initing test application https://github.com/prudhvir3ddy/EarlyEntryPoint-Sample/compare/main...workmanager-solution