Skip to content

Jacoco reports low coverage with Compose tests #1208

@arcadefire

Description

@arcadefire

Steps to reproduce

  • JaCoCo version: 0.8.7
  • Operating system: macOS Big Sur 11.4
  • Tool integration: Gradle
  • Complete executable reproducer: https://github.com/arcadefire/JacocoComposeSample
  • Steps:
    • Checkout to the repo above and execute the command: ./gradlew clean JacocoTestReport

Expected behaviour

Creating a simple composable function displaying a text and a test covering it that checks that the text was displayed should produce 100% test coverage.

Actual behaviour

The coverage for such a simple case is particularly low, especially the conditional coverage, even though the function contains no conditional logic.

Screenshot 2021-07-04 at 21 00 02

Also, looking at the function's coverage details, the yellow diamonds report a number of untested conditional branches.

Screenshot 2021-07-04 at 21 00 55

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions