Closed hufman closed 4 months ago
I've prepared a commit that runs the unit tests in Github Actions, to demonstrate the issue and for a future PR if you'd like.
This does not work on my side either.
I drafted a workaround that provides an explicit PreferencesReader injectable as a concrete class to mock, instead of trying to mock extension methods, and it works for me. I'm not sure if this is the best place for this class within the project architecture, or if it should be changed to just receive a Preferences collection or the overall Settings data class or specific Preference keys. Let me know what you think, and I could update the other Context.datastore usages to match.
Done ✅
1. Environment
2. Describe the bug
The recently added OPMLDataSourceTest test case does not succeed in my environment. I think my environment is running the underlying extension function as part of mocking
`when`(mockContext.currentAccountId).thenReturn(1)
:I tried a few alternative ways to set up the mock, but I can't get this test to work. How do you get the unit tests to pass in your environment?