ScalaTest User Guide

Getting started

Selecting testing styles

Defining base classes

Writing your first test

Using assertions

Tagging your tests

Running your tests

Sharing fixtures

Sharing tests

Using matchers

Testing with mock objects

Property-based testing

Asynchronous testing

Using Selenium

Using Scala-js

Using Inside

Using OptionValues

Using EitherValues

Using PartialFunctionValues

Using PrivateMethodTester

Using WrapWith

Philosophy and design

Migrating to 3.0

Using JUnitRunner

ScalaTest includes a JUnit Runner that knows how to run any ScalaTest Suite. This enables you to provide a JUnit RunWith annotation on any ScalaTest Suite. Here's an example:
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.FunSuite

@RunWith(classOf[JUnitRunner]) class ExampleSuite extends FunSuite { // ... }

This RunWith annotation will enable the ExampleSuite class to be run by JUnit 4.

ScalaTest is brought to you by Bill Venners and Artima.
ScalaTest is free, open-source software released under the Apache 2.0 license.

If your company loves ScalaTest, please consider sponsoring the project.

Copyright © 2009-2019 Artima, Inc. All Rights Reserved.

artima