CheckOps home

Tools directory

S

CheckOps

ScalaTest

ScalaTest is an Apache-2.0 testing toolkit for Scala and Java with many testing styles (FunSuite, FlatSpec, WordSpec and more), rich matchers and integration with sbt, Maven and IDEs.

Visit website

Latest public signals

Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.

Visit Website

Introduction

ScalaTest is the most widely used testing toolkit in the Scala ecosystem. It aims to be flexible, offering several testing styles so teams can choose the one that fits: AnyFunSuite for xUnit-like tests, AnyFlatSpec and AnyWordSpec for BDD-style specifications, AnyFreeSpec, AnyFeatureSpec for acceptance tests and others.

Assertions range from plain assert (with macro-enhanced failure messages) to a rich matchers DSL: result should be (5), list should contain allOf (1, 2), an [IllegalArgumentException] should be thrownBy { ... }. Fixtures can be shared through traits, BeforeAndAfter and loan patterns; async styles support Future-returning tests; and tags select tests. ScalaTest integrates with ScalaCheck for property-based testing (via scalatestplus), with Mockito through scalatestplus modules, and with sbt, Maven, Gradle, IntelliJ IDEA and Metals. It supports Scala 2.12, 2.13 and 3, as well as Scala.js and Scala Native. Version 3.2.20 was released on 26 March 2026.

The source code is at scalatest/scalatest on GitHub under the Apache-2.0 licence, with about 1,200 stars; the most recent commit was on 8 November 2026.

Features

  1. Many styles: FunSuite, FlatSpec, WordSpec, FreeSpec and more.
  2. Matchers DSL: Readable should matchers.
  3. Async testing: Future-based test styles.
  4. Cross-platform: Scala JVM, Scala.js and Scala Native.

Pros

  1. Free to use: Open source under the Apache-2.0 licence, so the core tool costs nothing to use.
  2. Actively maintained: The repository had commits as recent as 8 November 2026.

Cons

  1. Style choice overhead: Teams must agree on a style.
  2. Compile time: Large matcher DSL usage can slow compilation.
// build.sbt
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.20" % Test
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers

class PricingSuite extends AnyFunSuite with Matchers {
  test("applies discount") {
    Pricing.apply(100, 10) shouldBe 90
  }

  test("rejects negative prices") {
    an[IllegalArgumentException] should be thrownBy Pricing.apply(-1, 0)
  }
}
sbt test

Resources:

Pricing

ScalaTest is free and open source under the Apache-2.0 licence.

  1. Scala teams wanting a flexible, mature testing toolkit.
  2. Projects targeting Scala.js or Scala Native.

Conclusion

ScalaTest is the most established Scala testing toolkit, flexible enough to suit almost any team’s style.

Alternatives

Other tools on CheckOps that cover similar ground. Open a page, or compare one with ScalaTest side by side.