Why it matters

Good testing shapes reliable code. Understanding tools enables effective testing.

Advertisement

The architecture

ScalaTest: FunSuite, WordSpec, FreeSpec — many DSLs.

MUnit: JUnit compatible, less magic.

ScalaCheck: property-based testing.

Scala testing frameworksScalaTestmany DSLsMUnitJUnit-compatibleScalaCheckproperty-basedProperty-based testing finds edge cases automatically; standard for FP code
Testing options.
Advertisement

How it works end to end

Assertions: assertEquals, matchers ('should be'), pattern matching.

Property-based: 'forAll(gen) { x => property }'. Generates many inputs.

Async testing: for Future/IO tests.

Test containers for integration.