Hello, I get the following exception when trying t...
# compose-web
d
Hello, I get the following exception when trying to run an ui test using
runComposeUiTest
:
Copy code
[error] JsException: Exception was thrown while running JavaScript code

IllegalStateException: CompositionLocal LocalLifecycleOwner not present
Any ideas where this is coming from and how to resolive this? I'm using
Copy code
org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose
org.jetbrains.androidx.navigation:navigation-compose
that might be potential causes.
k
You have to do something like
Copy code
CompositionLocalProvider(LocalLifecycleOwner provides TestLifecycleOwner(Lifecycle.State.RESUMED)) {
            content()
        }
but a multiplatform TestLifecycleOwner is not published yet so you are supposed to copy it: https://github.com/JetBrains/compose-multiplatform-core/blob/1342b4daf25558fdd61be[…]monMain/kotlin/androidx/lifecycle/testing/TestLifecycleOwner.kt
d
Thanks, this resolves the error. Is there an eta on when TestLifecycleOwner will be published?