ScalaTest User Guide
Selecting testing styles
Defining base classes
Writing your first test
Tagging your tests
Running your tests
Testing with mock objects
Philosophy and design
Migrating to 3.0
ScalaTest support in the IntelliJ Scala plugin
The IntelliJ Scala plugin comes with good ScalaTest support, including:
First make sure that latest version Scala plugin is installed and enabled. Go to:
File -> Settings... -> PluginsOn a Macintosh, you would go to:
IntelliJ IDEA -> Preferences... -> Plugins
If it is not shown in the list, click
To use ScalaTest in your Scala project, you must make sure ScalaTest is included as a library in your module/project settings, both ScalaTest 1.x and the latest 2.0 version (recommended) are supported.
If you are using
libraryDependencies += "org.scalatest" % "scalatest_2.10" % "2.0" % "test"
and use sbt-idea to generate IntelliJ project files, which you can then easily open with IntelliJ.
If you want to configure the library dependency of IntelliJ project/module settings manually, please consult Configuring Module Dependencies and Libraries instead.
After your project built successfully, you can run any ScalaTest suite by right clicking on the source:
The results shown will follow the structure of the specification:
You can hop to the related source by double-clicking on the test (leaf) nodes, for scope nodes (e.g. the
Creating ScalaTest Run Configuration Manually
You can also create a ScalaTest run configuration manually by following:
Run -> Edit Configurations