Libraries ScalaTest + Play ScalaTest + Selenium ScalaTest + ScalaCheck ScalaTest + JUnit 4 ScalaTest + JUnit 5 ScalaTest + TestNG ScalaTest + EasyMock ScalaTest + JMock ScalaTest + Mockito |
ScalaTest + JUnit 5The ScalaTest + JUnit 5 integration library makes it fun and easy to use JUnit 5 with ScalaTest. ScalaTest + JUnit 5 provides the following features:
To use ScalaTest + JUnit 5, please add the following to your SBT project dependency: libraryDependencies += "org.scalatestplus" %% "junit-5-12" % "3.2.19.0" % "test" For maven you can use: <dependency> <groupId>org.scalatestplus</groupId> <artifactId>junit-5-12_3</artifactId> <version>3.2.19.0</version> <scope>test</scope> </dependency> For gradle you can use: dependencies { implementation "org.scala-lang:scala-library:3.3.4" testImplementation "org.scalatest:scalatest_3:3.2.19" testImplementation "org.junit.platform:junit-platform-launcher:1.12.0" testRuntimeOnly "org.junit.platform:junit-platform-engine:1.12.0" testRuntimeOnly "org.scalatestplus:junit-5-12_3:3.2.19.0" } test { useJUnitPlatform { includeEngines 'scalatest' testLogging { events("passed", "skipped", "failed", "standard_error") } } } For gradle (Kotlin) you can use: dependencies { implementation("org.scala-lang:scala-library:3.2.19") testImplementation("org.scalatest:scalatest_3:3.2.19") testRuntimeOnly("org.junit.platform:junit-platform-engine:1.12.0") testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.12.0") testRuntimeOnly("org.scalatestplus:junit-5-12_3:3.2.19.0") } tasks { test{ useJUnitPlatform { includeEngines("scalatest") testLogging { events("passed", "skipped", "failed") } } } } For Gradle project, by default IntelliJ IDEA uses Gradle's test runner to run tests, which at the time of writing does not work with Jump to Source feature. You may switch to use IntelliJ IDEA's test runner by following the instructions here. |
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.