slackhq / circuit

⚡️ A Compose-driven architecture for Kotlin and Android applications.
https://slackhq.github.io/circuit/
Apache License 2.0
1.52k stars 76 forks source link

Missing Configuration in Testing Documentation #1760

Open kezc opened 3 weeks ago

kezc commented 3 weeks ago

hello! I am using Circuit with KMP for my project and I could not get test running. I read whole https://slackhq.github.io/circuit/testing/ but I was getting error

Method beginSection in android.os.Trace not mocked. See <http://g.co/androidstudio/not-mocked> for details.java.lang.RuntimeException: Method beginSection in android.os.Trace not mocked. See <http://g.co/androidstudio/not-mocked> for details.

I believe circuit uses moluce under the hood, which in the readme has section that the project should include in the top level build.gradle:

android {
   testOptions {
        unitTests.isReturnDefaultValues = true
    }
}

source: https://github.com/cashapp/molecule?tab=readme-ov-file#testing (I had to use isReturnDefaultValues instead of returnDefaultValues) Could you add it to documentation? I think it would be very helpful

ZacSweers commented 3 weeks ago

Want to send a PR?