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 Scala-js Using Inside Using OptionValues Using EitherValues Using PartialFunctionValues Using PrivateMethodTester Using WrapWith Philosophy and design Migrating to 3.0 |
ScalaTest support in the IntelliJ Scala pluginThe IntelliJ Scala plugin comes with good ScalaTest support, including:
Scala pluginFirst 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 ![]()
Close the Using ScalaTestTo 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. Running ScalaTestAfter 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 ManuallyYou can also create a ScalaTest run configuration manually by following: Run -> Edit Configurations
Click on ![]() |
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-2025 Artima, Inc. All Rights Reserved.