Search code examples
scalatestakka-testkit

akka-testkit without ScalaTest


I want to use utest with akka-testkit. How can I disable ScalaTest in akka-testkit?

Running the test an empty ScalaTest is executed every time.

[info] ScalaTest
[info] Run completed in 957 milliseconds.
[info] Total number of tests run: 0
[info] Suites: completed 0, aborted 0
[info] Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0
[info] No tests were executed.
[info] utest
[info] Tests: 1, Passed: 1, Failed: 0
[info] Passed: Total 1, Failed 0, Errors 0, Passed 1

Solution

  • Try unregistering ScalaTest by filtering it out of testFrameworks setting in build.sbt like so

    testFrameworks := {
      testFrameworks.value.filterNot(_.toString.contains("scalatest"))
    }
    

    Now show testFrameworks gives

    show testFrameworks
    [info] * TestFramework(org.scalacheck.ScalaCheckFramework)
    [info] * TestFramework(org.specs2.runner.Specs2Framework, org.specs2.runner.SpecsFramework)
    [info] * TestFramework(org.specs.runner.SpecsFramework)
    [info] * TestFramework(com.novocode.junit.JUnitFramework)
    [info] * TestFramework(utest.runner.Framework)
    

    where we see TestFramework(org.scalatest.tools.Framework, org.scalatest.tools.ScalaTestFramework) is not present.