https://github.com/helmethair-co/scalatest-junit-runner
JUnit 5 runner for Scalatest
https://github.com/helmethair-co/scalatest-junit-runner
gradle gradle-plugin junit junit-5 junit-platform junit-runner junit-test junit-tests scala scalatest scalatest-junit-runner scalatesting test testing testing-library testing-tool testing-tools
Last synced: 9 months ago
JSON representation
JUnit 5 runner for Scalatest
- Host: GitHub
- URL: https://github.com/helmethair-co/scalatest-junit-runner
- Owner: helmethair-co
- License: mit
- Created: 2020-02-28T20:43:39.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-05-10T08:27:48.000Z (over 1 year ago)
- Last Synced: 2024-11-15T09:49:17.402Z (about 1 year ago)
- Topics: gradle, gradle-plugin, junit, junit-5, junit-platform, junit-runner, junit-test, junit-tests, scala, scalatest, scalatest-junit-runner, scalatesting, test, testing, testing-library, testing-tool, testing-tools
- Language: Java
- Homepage:
- Size: 359 KB
- Stars: 37
- Watchers: 4
- Forks: 10
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# ScalaTest Junit 5 runner
[](https://github.com/helmethair-co/scalatest-junit-runner/actions?query=workflow%3A%22Test%22+branch%3Amain+event%3Apush)
[](https://codecov.io/gh/helmethair-co/scalatest-junit-runner)
[](https://maven-badges.herokuapp.com/maven-central/co.helmethair/scalatest-junit-runner)
[JUnit 5](https://junit.org/junit5/docs/current/user-guide/) runner library for [ScalaTest](http://www.scalatest.org/) tests. It can be used to fully [integrate ScalaTest into Gradle](https://www.baeldung.com/junit-5-gradle) (version >= 4.5) and to Maven.
There is an open [issue](https://github.com/scalatest/scalatest/issues/1454) to natively support JUnit 5 in ScalaTest without this library.
## Getting Started
## Features
* Running ScalaTest test on the Junit 5 platform
* Fully integrate ScalaTest into gradle
* Report individual test runs
* Report errors to JUnit 5 with stack traces
* Support ScalaTest tags
* Optional early stopping after the first test fail
## How to use
### Gradle
version >= 4.5
This library allows to run ScalaTest on the new JUnit Platform (JUnit 5)
To run ScalaTest on the old JUnit Vintage (JUnit 4) platform use the [gradle-scalatest](https://plugins.gradle.org/plugin/com.github.maiflai.scalatest) Gradle plugin.
#### Groovy
gradle.properties
```properties
scala_lib_version=2.12
scala_version=2.12.10
junit_platform_version=1.6.0
```
build.gradle
```groovy
plugins {
id 'scala'
}
repositories {
jcenter()
}
dependencies {
implementation "org.scala-lang:scala-library:$scala_version"
testImplementation "org.scalatest:scalatest_$scala_lib_version:3.2.0-M3"
testRuntime "org.junit.platform:junit-platform-engine:$junit_platform_version"
testRuntime "org.junit.platform:junit-platform-launcher:$junit_platform_version"
testRuntime "co.helmethair:scalatest-junit-runner:0.1.11"
}
test {
useJUnitPlatform {
includeEngines 'scalatest'
testLogging {
events("passed", "skipped", "failed")
}
}
}
```
See [example Groovy Gradle project](https://github.com/helmethair-co/scalatest-junit-runner/tree/master/gradle-example)
#### Kotlin DSL
build.gradle.kts
```kotlin
...
tasks {
test{
useJUnitPlatform {
includeEngines("scalatest")
testLogging {
events("passed", "skipped", "failed")
}
}
}
}
```
See [example Kotlin DSL Gradle project](https://github.com/helmethair-co/scalatest-junit-runner/tree/master/gradle-kotlin-dsl-example)
### Maven
Surefire plugin version >= 2.22.0
pom.xml
```xml
org.scala-lang
scala-library
${scala.version}
compile
org.junit.platform
junit-platform-engine
${junit.version}
test
org.scalatest
scalatest_${scala.compat.version}
${scalatest.version}
test
co.helmethair
scalatest-junit-runner
${scalatest.runner.version}
test
src/main/scala
src/test/scala
...
org.apache.maven.plugins
maven-surefire-plugin
${maven.surefire.version}
...
```
See [example maven project](https://github.com/helmethair-co/scalatest-junit-runner/tree/main/maven-example)
### JUnit console
Add the library to the classpath and run your test
## Built With
* [ScalaTest](http://www.scalatest.org)
* [Kotlin](http://kotlinlang.org/) - Kotlin DSL for Gradle
* [Gradle](http://gradle.org/) - Build tool
* [Gradle Test Logger Plugin](https://plugins.gradle.org/plugin/com.adarshr.test-logger)
* [semver-git-plugin](https://github.com/ilovemilk/semver-git-plugin)
## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
We use [semantic versioning](http://semver.org/).
This project is licensed under the MIT License - see the [LICENSE](LICENSE) for details