Skip to main content

Supported test frameworks

Bleep auto-detects the test framework for each test project from its dependencies. Add the dependency to your mylib-test project and bleep test will use the right framework.

Auto-detected frameworks

FrameworkMaven coordinate (any of)Notes
JUnit Jupiter (JUnit 5)org.junit.jupiter:junit-jupiter, :junit-jupiter-api, :junit-jupiter-engineBleep injects net.aichler:jupiter-interface:0.11.1 automatically — you do not declare it.
JUnit 4junit:junit, org.jetbrains.kotlin:kotlin-test-junitBleep injects com.github.sbt:junit-interface:0.13.3 automatically.
ScalaTestorg.scalatest::scalatestImplements sbt test-interface natively.
specs2org.specs2::specs2-coreNative test-interface.
MUnitorg.scalameta::munitNative test-interface.
utestcom.lihaoyi::utestNative test-interface.
ZIO Testdev.zio::zio-testNative test-interface.
weaver-catscom.disneystreaming::weaver-catsNative test-interface.

Detection is by artifact name, not by group. If your dependency coordinates match the artifact column above, bleep treats the project as using that framework.

Multiple frameworks in one project

A single test project can use multiple frameworks — declare each as a dependency and bleep test runs all of them:

projects:
mylib-test:
isTestProject: true
dependsOn: mylib
dependencies:
- org.junit.jupiter:junit-jupiter:5.10.1 # JUnit 5
- org.scalameta::munit:1.0.0 # MUnit

Frameworks not on this list

If you depend on a framework that implements sbt test-interface and isn't auto-detected, you can declare it explicitly:

projects:
mylib-test:
isTestProject: true
testFrameworks:
- org.example.test.MyFramework

The fully qualified class name is the value of the framework's Framework SPI implementation. Check the framework's documentation for its Framework class name.

How bleep test runs them

For each test project, bleep:

  1. Compiles the project (and its dependencies) like any other project.
  2. Spawns a JVM (or Node, for Scala.js / Kotlin/JS test projects) with the test classpath, including the auto-injected adapter for JUnit 4 / JUnit 5 if relevant.
  3. Discovers test classes via the framework's test-interface implementation.
  4. Runs the discovered tests, streaming results back via BSP.

The discovery + run flow is the same as sbt's, since bleep uses sbt test-interface as the framework boundary.

See also