brettchabot

Results 86 comments of brettchabot

It does take some code to setup the android environment, so there will be some overhead to using robolectric. Try annotating your tests with @LazyApplication(LazyApplication.LazyLoad.ON) or pass robolectric.lazyload=ON as a...

I suspect this issue has the same root cause [755](https://github.com/robolectric/robolectric/issues/7055) [AndroidUiDispatcher keeps a static reference to Choreographer.getInstance](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidUiDispatcher.android.kt;drc=bcaacc85477f959cac171b60258679b6244f512b;l=156) which is then reused among tests. This is bad because Robolectric resets the...

This is still ugly but I was able to simplify the workaround to the following: ``` val uiDispatcher : AndroidUiDispatcher = ReflectionHelpers.getField(AndroidUiDispatcher.Main, "element", ) ReflectionHelpers.setField(uiDispatcher, "choreographer", Choreographer.getInstance()) ```

Sorry for the confusion, the fix is not in 4.13. I just submitted it to the google branch now, hopefully it will be in upcoming releases.

> > * [`@Nonnull`](https://github.com/search?q=repo%3Arobolectric%2Frobolectric+%22%40Nonnull%22&type=code&rgh-link-date=2025-01-23T07%3A58%3A25Z) is used pretty much everywhere. > > * [`@Nullable`](https://github.com/search?q=repo%3Arobolectric%2Frobolectric+%22%40Nullable%22&type=code&rgh-link-date=2025-01-23T07%3A58%3A25Z) is used pretty much everywhere. > > For the nullability annotations, maybe we could migrate to [JSpecify](https://jspecify.dev/docs/using/#if-your-code-already-uses-jsr-305-annotations)?...