Testing

Elide runs your project's tests with a single command and can produce coverage reports. Tests are declared through source sets and executed as part of the build task graph.

Running tests

shell
 elide test
elide test executes the project's testing task group. For JVM projects this runs the JUnit-based test tasks registered for your test source sets.
Note

Test execution currently covers JVM (JUnit) tests. Dedicated JavaScript/TypeScript and Python test runners are not yet wired into elide test.

Coverage

Coverage is configured in the top-level testing { } block of your elide.pkl manifest. JVM coverage is backed by JaCoCo:

pkl
amends "elide:project.pkl"
import "elide:Jvm.pkl" as Jvm

testing {
  coverage {
    jvm {
      enabled = true
      reports {
        Jvm.htmlReport()
        Jvm.xmlReport()
      }
    }
  }
}

testing.coverage.jvm fields

FieldTypeDefaultDescription
enabledBooleantrueWhether JVM coverage collection is active
reportsListing<JvmCoverageReport>{}Coverage reports to generate

Report formats

ReportHelperDescription
htmlJvm.htmlReport()Browsable HTML coverage report
xmlJvm.xmlReport()XML coverage report (for CI tooling)
csvJvm.csvReport()CSV coverage report
Each report can also be constructed directly, for example new Jvm.HtmlCoverageReport {}.