From 6225254b81b992261c477d9954ed4e29e7ae65b7 Mon Sep 17 00:00:00 2001 From: ckipp01 Date: Fri, 7 May 2021 14:23:03 +0200 Subject: [PATCH] Update tests in scripted. Normally I wouldn't have updated these, but since specs2 changed namespaces and I needed to go through and change everything since the current one wasn't published for newer versions of Scala. Therefore I just opted to migrate to a newer testframework that I do know will continue to be supported. I also then bumped the Scala versions in the actual tests. --- .../scoverage/aggregate-only/build.sbt | 18 ++++++------ .../partA/src/test/scala/AdderTestSuite.scala | 15 ++++------ .../src/test/scala/SubtractorTestSuite.scala | 16 ++++------- src/sbt-test/scoverage/aggregate-only/test | 10 +++---- src/sbt-test/scoverage/aggregate/build.sbt | 18 ++++++------ .../partA/src/test/scala/AdderTestSuite.scala | 15 ++++------ .../src/test/scala/SubtractorTestSuite.scala | 16 ++++------- src/sbt-test/scoverage/aggregate/test | 10 +++---- src/sbt-test/scoverage/bad-coverage/build.sbt | 7 +++-- .../src/test/scala/BadCoverageSpec.scala | 15 ++++------ src/sbt-test/scoverage/coverage-off/build.sbt | 7 +++-- .../src/test/scala/GoodCoverageSpec.scala | 15 ++++------ .../scoverage/good-coverage/build.sbt | 7 +++-- .../src/test/scala/GoodCoverageSpec.scala | 15 ++++------ src/sbt-test/scoverage/preserve-set/build.sbt | 28 +++++++++++++------ .../src/test/scala/PreserveSetSpec.scala | 10 +++---- src/sbt-test/scoverage/preserve-set/test | 6 ++-- .../scoverage/scalac-plugin-version/build.sbt | 7 +++-- src/sbt-test/scoverage/scalajs/build.sbt | 16 +++++------ .../sjstest/js/src/test/scala/JsTest.scala | 10 +++---- .../sjstest/jvm/src/test/scala/JvmTest.scala | 10 +++---- .../shared/src/test/scala/SharedTest.scala | 9 +++--- src/sbt-test/scoverage/scalajs/test | 8 +++--- 23 files changed, 137 insertions(+), 151 deletions(-) diff --git a/src/sbt-test/scoverage/aggregate-only/build.sbt b/src/sbt-test/scoverage/aggregate-only/build.sbt index 3ca537e3..da1eb7b9 100644 --- a/src/sbt-test/scoverage/aggregate-only/build.sbt +++ b/src/sbt-test/scoverage/aggregate-only/build.sbt @@ -1,23 +1,21 @@ /* The projects test aggregation of coverage reports from two sub-projects. The sub-projects are in the directories partA and partB. -*/ + */ lazy val commonSettings = Seq( organization := "org.scoverage", version := "0.1.0", - scalaVersion := "2.12.13" + scalaVersion := "2.13.5" ) -lazy val specs2Lib = "org.specs2" %% "specs2" % "2.5" % "test" - def module(name: String) = { val id = s"part$name" Project(id = id, base = file(id)) .settings(commonSettings: _*) .settings( Keys.name := name, - libraryDependencies += specs2Lib + libraryDependencies += "org.scalameta" %% "munit" % "0.7.25" % Test ) } @@ -25,16 +23,18 @@ lazy val partA = module("A") lazy val partB = module("B") lazy val root = (project in file(".")) - .settings(commonSettings:_*) + .settings(commonSettings: _*) .settings( name := "root", - test := { } - ).aggregate( + test := {} + ) + .aggregate( partA, partB ) ThisBuild / resolvers ++= { - if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) Seq(Resolver.sonatypeRepo("snapshots")) + if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) + Seq(Resolver.sonatypeRepo("snapshots")) else Seq.empty } diff --git a/src/sbt-test/scoverage/aggregate-only/partA/src/test/scala/AdderTestSuite.scala b/src/sbt-test/scoverage/aggregate-only/partA/src/test/scala/AdderTestSuite.scala index 63efd2b9..71204c58 100644 --- a/src/sbt-test/scoverage/aggregate-only/partA/src/test/scala/AdderTestSuite.scala +++ b/src/sbt-test/scoverage/aggregate-only/partA/src/test/scala/AdderTestSuite.scala @@ -1,13 +1,10 @@ -import org.specs2.mutable._ +import munit.FunSuite import org.scoverage.issue53.part.a.AdderScala -/** - * Created by Mikhail Kokho on 7/10/2015. - */ -class AdderTestSuite extends Specification { - "Adder" should { - "sum two numbers" in { - AdderScala.add(1, 2) mustEqual 3 - } +/** Created by Mikhail Kokho on 7/10/2015. + */ +class AdderTestSuite extends FunSuite { + test("Adder should sum two numbers") { + assertEquals(AdderScala.add(1, 2), 3) } } diff --git a/src/sbt-test/scoverage/aggregate-only/partB/src/test/scala/SubtractorTestSuite.scala b/src/sbt-test/scoverage/aggregate-only/partB/src/test/scala/SubtractorTestSuite.scala index 97c5266f..6b2ededf 100644 --- a/src/sbt-test/scoverage/aggregate-only/partB/src/test/scala/SubtractorTestSuite.scala +++ b/src/sbt-test/scoverage/aggregate-only/partB/src/test/scala/SubtractorTestSuite.scala @@ -1,14 +1,10 @@ -import org.specs2.mutable._ +import munit.FunSuite import org.scoverage.issue53.part.b.SubtractorScala -/** - * Created by Mikhail Kokho on 7/10/2015. - */ -class SubtractorTestSuite extends Specification { - "Subtractor" should { - "subtract two numbers" in { - SubtractorScala.minus(2, 1) mustEqual 1 - } +/** Created by Mikhail Kokho on 7/10/2015. + */ +class SubtractorTestSuite extends FunSuite { + test("Subtractor should subtract two numbers") { + assertEquals(SubtractorScala.minus(2, 1), 1) } } - diff --git a/src/sbt-test/scoverage/aggregate-only/test b/src/sbt-test/scoverage/aggregate-only/test index fb0d70f6..26983121 100644 --- a/src/sbt-test/scoverage/aggregate-only/test +++ b/src/sbt-test/scoverage/aggregate-only/test @@ -3,12 +3,12 @@ > coverage > test # There should be scoverage-data directories for modules -$ exists partA/target/scala-2.12/scoverage-data -$ exists partB/target/scala-2.12/scoverage-data +$ exists partA/target/scala-2.13/scoverage-data +$ exists partB/target/scala-2.13/scoverage-data # Generate aggregated reports without generating per-module reports first > coverageAggregate # There shouldn't be scoverage-report directories for modules --$ exists partA/target/scala-2.12/scoverage-report --$ exists partB/target/scala-2.12/scoverage-report +-$ exists partA/target/scala-2.13/scoverage-report +-$ exists partB/target/scala-2.13/scoverage-report # There should be a root scoverage-report directory -$ exists target/scala-2.12/scoverage-report \ No newline at end of file +$ exists target/scala-2.13/scoverage-report diff --git a/src/sbt-test/scoverage/aggregate/build.sbt b/src/sbt-test/scoverage/aggregate/build.sbt index 3ca537e3..da1eb7b9 100644 --- a/src/sbt-test/scoverage/aggregate/build.sbt +++ b/src/sbt-test/scoverage/aggregate/build.sbt @@ -1,23 +1,21 @@ /* The projects test aggregation of coverage reports from two sub-projects. The sub-projects are in the directories partA and partB. -*/ + */ lazy val commonSettings = Seq( organization := "org.scoverage", version := "0.1.0", - scalaVersion := "2.12.13" + scalaVersion := "2.13.5" ) -lazy val specs2Lib = "org.specs2" %% "specs2" % "2.5" % "test" - def module(name: String) = { val id = s"part$name" Project(id = id, base = file(id)) .settings(commonSettings: _*) .settings( Keys.name := name, - libraryDependencies += specs2Lib + libraryDependencies += "org.scalameta" %% "munit" % "0.7.25" % Test ) } @@ -25,16 +23,18 @@ lazy val partA = module("A") lazy val partB = module("B") lazy val root = (project in file(".")) - .settings(commonSettings:_*) + .settings(commonSettings: _*) .settings( name := "root", - test := { } - ).aggregate( + test := {} + ) + .aggregate( partA, partB ) ThisBuild / resolvers ++= { - if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) Seq(Resolver.sonatypeRepo("snapshots")) + if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) + Seq(Resolver.sonatypeRepo("snapshots")) else Seq.empty } diff --git a/src/sbt-test/scoverage/aggregate/partA/src/test/scala/AdderTestSuite.scala b/src/sbt-test/scoverage/aggregate/partA/src/test/scala/AdderTestSuite.scala index 63efd2b9..71204c58 100644 --- a/src/sbt-test/scoverage/aggregate/partA/src/test/scala/AdderTestSuite.scala +++ b/src/sbt-test/scoverage/aggregate/partA/src/test/scala/AdderTestSuite.scala @@ -1,13 +1,10 @@ -import org.specs2.mutable._ +import munit.FunSuite import org.scoverage.issue53.part.a.AdderScala -/** - * Created by Mikhail Kokho on 7/10/2015. - */ -class AdderTestSuite extends Specification { - "Adder" should { - "sum two numbers" in { - AdderScala.add(1, 2) mustEqual 3 - } +/** Created by Mikhail Kokho on 7/10/2015. + */ +class AdderTestSuite extends FunSuite { + test("Adder should sum two numbers") { + assertEquals(AdderScala.add(1, 2), 3) } } diff --git a/src/sbt-test/scoverage/aggregate/partB/src/test/scala/SubtractorTestSuite.scala b/src/sbt-test/scoverage/aggregate/partB/src/test/scala/SubtractorTestSuite.scala index 97c5266f..4bec321a 100644 --- a/src/sbt-test/scoverage/aggregate/partB/src/test/scala/SubtractorTestSuite.scala +++ b/src/sbt-test/scoverage/aggregate/partB/src/test/scala/SubtractorTestSuite.scala @@ -1,14 +1,10 @@ -import org.specs2.mutable._ +import munit.FunSuite import org.scoverage.issue53.part.b.SubtractorScala -/** - * Created by Mikhail Kokho on 7/10/2015. - */ -class SubtractorTestSuite extends Specification { - "Subtractor" should { - "subtract two numbers" in { - SubtractorScala.minus(2, 1) mustEqual 1 - } +/** Created by Mikhail Kokho on 7/10/2015. + */ +class SubtractorTestSuite extends FunSuite { + test("Subtractor should substract two numbers") { + assertEquals(SubtractorScala.minus(2, 1), 1) } } - diff --git a/src/sbt-test/scoverage/aggregate/test b/src/sbt-test/scoverage/aggregate/test index 9475fbbb..2a4f5fc3 100644 --- a/src/sbt-test/scoverage/aggregate/test +++ b/src/sbt-test/scoverage/aggregate/test @@ -3,12 +3,12 @@ > coverage > test # There should be scoverage-data directory -$ exists partA/target/scala-2.12/scoverage-data -$ exists partB/target/scala-2.12/scoverage-data +$ exists partA/target/scala-2.13/scoverage-data +$ exists partB/target/scala-2.13/scoverage-data > coverageReport # There should be scoverage-report directory -$ exists partA/target/scala-2.12/scoverage-report -$ exists partB/target/scala-2.12/scoverage-report +$ exists partA/target/scala-2.13/scoverage-report +$ exists partB/target/scala-2.13/scoverage-report > coverageAggregate # There should be a root scoverage-report directory -$ exists target/scala-2.12/scoverage-report \ No newline at end of file +$ exists target/scala-2.13/scoverage-report diff --git a/src/sbt-test/scoverage/bad-coverage/build.sbt b/src/sbt-test/scoverage/bad-coverage/build.sbt index 30698311..de77b640 100644 --- a/src/sbt-test/scoverage/bad-coverage/build.sbt +++ b/src/sbt-test/scoverage/bad-coverage/build.sbt @@ -1,14 +1,15 @@ version := "0.1" -scalaVersion := "2.12.13" +scalaVersion := "2.13.5" -libraryDependencies += "org.specs2" %% "specs2" % "2.5" % "test" +libraryDependencies += "org.scalameta" %% "munit" % "0.7.25" % Test coverageMinimum := 80 coverageFailOnMinimum := true resolvers ++= { - if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) Seq(Resolver.sonatypeRepo("snapshots")) + if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) + Seq(Resolver.sonatypeRepo("snapshots")) else Seq.empty } diff --git a/src/sbt-test/scoverage/bad-coverage/src/test/scala/BadCoverageSpec.scala b/src/sbt-test/scoverage/bad-coverage/src/test/scala/BadCoverageSpec.scala index 16ce924b..1faa5e5a 100644 --- a/src/sbt-test/scoverage/bad-coverage/src/test/scala/BadCoverageSpec.scala +++ b/src/sbt-test/scoverage/bad-coverage/src/test/scala/BadCoverageSpec.scala @@ -1,13 +1,10 @@ -import org.specs2.mutable._ +import munit.FunSuite -/** - * Created by tbarke001c on 7/8/14. - */ -class BadCoverageSpec extends Specification { +/** Created by tbarke001c on 7/8/14. + */ +class BadCoverageSpec extends FunSuite { - "BadCoverage" should { - "sum two numbers" in { - BadCoverage.sum(1, 2) mustEqual 3 - } + test("BadCoverage should sum two numbers") { + assertEquals(BadCoverage.sum(1, 2), 3) } } diff --git a/src/sbt-test/scoverage/coverage-off/build.sbt b/src/sbt-test/scoverage/coverage-off/build.sbt index 30698311..de77b640 100644 --- a/src/sbt-test/scoverage/coverage-off/build.sbt +++ b/src/sbt-test/scoverage/coverage-off/build.sbt @@ -1,14 +1,15 @@ version := "0.1" -scalaVersion := "2.12.13" +scalaVersion := "2.13.5" -libraryDependencies += "org.specs2" %% "specs2" % "2.5" % "test" +libraryDependencies += "org.scalameta" %% "munit" % "0.7.25" % Test coverageMinimum := 80 coverageFailOnMinimum := true resolvers ++= { - if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) Seq(Resolver.sonatypeRepo("snapshots")) + if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) + Seq(Resolver.sonatypeRepo("snapshots")) else Seq.empty } diff --git a/src/sbt-test/scoverage/coverage-off/src/test/scala/GoodCoverageSpec.scala b/src/sbt-test/scoverage/coverage-off/src/test/scala/GoodCoverageSpec.scala index cbf6a70d..b1d4ddfc 100644 --- a/src/sbt-test/scoverage/coverage-off/src/test/scala/GoodCoverageSpec.scala +++ b/src/sbt-test/scoverage/coverage-off/src/test/scala/GoodCoverageSpec.scala @@ -1,13 +1,10 @@ -import org.specs2.mutable._ +import munit.FunSuite -/** - * Created by tbarke001c on 7/8/14. - */ -class GoodCoverageSpec extends Specification { +/** Created by tbarke001c on 7/8/14. + */ +class GoodCoverageSpec extends FunSuite { - "GoodCoverage" should { - "sum two numbers" in { - GoodCoverage.sum(1, 2) mustEqual 3 - } + test("GoodCoverage should sum two numvers") { + assertEquals(GoodCoverage.sum(1, 2), 3) } } diff --git a/src/sbt-test/scoverage/good-coverage/build.sbt b/src/sbt-test/scoverage/good-coverage/build.sbt index 30698311..de77b640 100644 --- a/src/sbt-test/scoverage/good-coverage/build.sbt +++ b/src/sbt-test/scoverage/good-coverage/build.sbt @@ -1,14 +1,15 @@ version := "0.1" -scalaVersion := "2.12.13" +scalaVersion := "2.13.5" -libraryDependencies += "org.specs2" %% "specs2" % "2.5" % "test" +libraryDependencies += "org.scalameta" %% "munit" % "0.7.25" % Test coverageMinimum := 80 coverageFailOnMinimum := true resolvers ++= { - if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) Seq(Resolver.sonatypeRepo("snapshots")) + if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) + Seq(Resolver.sonatypeRepo("snapshots")) else Seq.empty } diff --git a/src/sbt-test/scoverage/good-coverage/src/test/scala/GoodCoverageSpec.scala b/src/sbt-test/scoverage/good-coverage/src/test/scala/GoodCoverageSpec.scala index cbf6a70d..4e88b703 100644 --- a/src/sbt-test/scoverage/good-coverage/src/test/scala/GoodCoverageSpec.scala +++ b/src/sbt-test/scoverage/good-coverage/src/test/scala/GoodCoverageSpec.scala @@ -1,13 +1,10 @@ -import org.specs2.mutable._ +import munit.FunSuite -/** - * Created by tbarke001c on 7/8/14. - */ -class GoodCoverageSpec extends Specification { +/** Created by tbarke001c on 7/8/14. + */ +class GoodCoverageSpec extends FunSuite { - "GoodCoverage" should { - "sum two numbers" in { - GoodCoverage.sum(1, 2) mustEqual 3 - } + test("GoodCoverage should sum two numbers") { + assertEquals(GoodCoverage.sum(1, 2), 3) } } diff --git a/src/sbt-test/scoverage/preserve-set/build.sbt b/src/sbt-test/scoverage/preserve-set/build.sbt index 35e9bd25..cacb0594 100644 --- a/src/sbt-test/scoverage/preserve-set/build.sbt +++ b/src/sbt-test/scoverage/preserve-set/build.sbt @@ -2,29 +2,39 @@ import sbt.complete.DefaultParsers._ version := "0.1" -scalaVersion := "2.12.13" +scalaVersion := "2.13.5" -crossScalaVersions := Seq("2.12.13") +crossScalaVersions := Seq("2.13.5") -libraryDependencies += "org.specs2" %% "specs2" % "2.5" % "test" +libraryDependencies += "org.scalameta" %% "munit" % "0.7.25" % Test -val checkScalaVersion = inputKey[Unit]("Input task to compare the value of scalaVersion setting with a given input.") +val checkScalaVersion = inputKey[Unit]( + "Input task to compare the value of scalaVersion setting with a given input." +) checkScalaVersion := { val arg: String = (Space ~> StringBasic).parsed - if (scalaVersion.value != arg) sys.error(s"scalaVersion [${scalaVersion.value}] not equal to expected [$arg]") + if (scalaVersion.value != arg) + sys.error( + s"scalaVersion [${scalaVersion.value}] not equal to expected [$arg]" + ) () } -val checkScoverageEnabled = inputKey[Unit]("Input task to compare the value of coverageEnabled setting with a given input.") +val checkScoverageEnabled = inputKey[Unit]( + "Input task to compare the value of coverageEnabled setting with a given input." +) checkScoverageEnabled := { val arg: String = (Space ~> StringBasic).parsed - if (coverageEnabled.value.toString != arg) sys.error(s"coverageEnabled [${coverageEnabled.value}] not equal to expected [$arg]") + if (coverageEnabled.value.toString != arg) + sys.error( + s"coverageEnabled [${coverageEnabled.value}] not equal to expected [$arg]" + ) () } - resolvers ++= { - if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) Seq(Resolver.sonatypeRepo("snapshots")) + if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) + Seq(Resolver.sonatypeRepo("snapshots")) else Seq.empty } diff --git a/src/sbt-test/scoverage/preserve-set/src/test/scala/PreserveSetSpec.scala b/src/sbt-test/scoverage/preserve-set/src/test/scala/PreserveSetSpec.scala index a7722e39..c4c26010 100644 --- a/src/sbt-test/scoverage/preserve-set/src/test/scala/PreserveSetSpec.scala +++ b/src/sbt-test/scoverage/preserve-set/src/test/scala/PreserveSetSpec.scala @@ -1,10 +1,8 @@ -import org.specs2.mutable._ +import munit.FunSuite -class PreserveSetSpec extends Specification { +class PreserveSetSpec extends FunSuite { - "PreserveSet" should { - "sum two numbers" in { - PreserveSet.sum(1, 2) mustEqual 3 - } + test("PreserveSet should sum two numbers") { + assertEquals(PreserveSet.sum(1, 2), 3) } } diff --git a/src/sbt-test/scoverage/preserve-set/test b/src/sbt-test/scoverage/preserve-set/test index 349f1853..1d8ab737 100644 --- a/src/sbt-test/scoverage/preserve-set/test +++ b/src/sbt-test/scoverage/preserve-set/test @@ -1,8 +1,8 @@ # check scalaVersion setting -> checkScalaVersion "2.12.13" +> checkScalaVersion "2.13.5" > checkScoverageEnabled "false" > coverage > checkScoverageEnabled "true" > coverageOff -> checkScalaVersion "2.12.13" -> checkScoverageEnabled "false" \ No newline at end of file +> checkScalaVersion "2.13.5" +> checkScoverageEnabled "false" diff --git a/src/sbt-test/scoverage/scalac-plugin-version/build.sbt b/src/sbt-test/scoverage/scalac-plugin-version/build.sbt index f5e663f7..df7f1c7c 100644 --- a/src/sbt-test/scoverage/scalac-plugin-version/build.sbt +++ b/src/sbt-test/scoverage/scalac-plugin-version/build.sbt @@ -5,10 +5,13 @@ lazy val root = (project in file(".")).settings( TaskKey[Unit]("check") := { assert( libraryDependencies.value.count(module => - module.organization == "org.scoverage" && module.revision == "1.3.0") == 2) + module.organization == "org.scoverage" && module.revision == "1.3.0" + ) == 2 + ) } resolvers ++= { - if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) Seq(Resolver.sonatypeRepo("snapshots")) + if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) + Seq(Resolver.sonatypeRepo("snapshots")) else Seq.empty } diff --git a/src/sbt-test/scoverage/scalajs/build.sbt b/src/sbt-test/scoverage/scalajs/build.sbt index 4b1074b5..59494e18 100644 --- a/src/sbt-test/scoverage/scalajs/build.sbt +++ b/src/sbt-test/scoverage/scalajs/build.sbt @@ -3,19 +3,19 @@ import sbtcrossproject.CrossType lazy val root = (project in file(".")).aggregate(crossJS, crossJVM) -lazy val cross = CrossProject("sjstest", file("sjstest"))(JVMPlatform, JSPlatform) - .crossType(CrossType.Full) - .settings( - scalaVersion := "2.12.13", - libraryDependencies ++= Seq( - "org.scalatest" %% "scalatest" % "3.2.8" % "test" +lazy val cross = + CrossProject("sjstest", file("sjstest"))(JVMPlatform, JSPlatform) + .crossType(CrossType.Full) + .settings( + scalaVersion := "2.13.5", + libraryDependencies += "org.scalameta" %% "munit" % "0.7.25" % Test ) - ) lazy val crossJS = cross.js lazy val crossJVM = cross.jvm ThisBuild / resolvers ++= { - if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) Seq(Resolver.sonatypeRepo("snapshots")) + if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) + Seq(Resolver.sonatypeRepo("snapshots")) else Seq.empty } diff --git a/src/sbt-test/scoverage/scalajs/sjstest/js/src/test/scala/JsTest.scala b/src/sbt-test/scoverage/scalajs/sjstest/js/src/test/scala/JsTest.scala index d11e4236..c7d3eed4 100644 --- a/src/sbt-test/scoverage/scalajs/sjstest/js/src/test/scala/JsTest.scala +++ b/src/sbt-test/scoverage/scalajs/sjstest/js/src/test/scala/JsTest.scala @@ -1,11 +1,9 @@ -import org.scalatest.flatspec.AnyFlatSpec -import org.scalatest.matchers.should.Matchers +import munit.FunSuite -class JsTest extends AnyFlatSpec with Matchers { +class JsTest extends FunSuite { - "JS UnderTest" should "work on JS" in { - UnderTest.jsMethod shouldBe "js" + test("JS UnderTest should work on JS") { + assertEquals(UnderTest.jsMethod, "js") } } - diff --git a/src/sbt-test/scoverage/scalajs/sjstest/jvm/src/test/scala/JvmTest.scala b/src/sbt-test/scoverage/scalajs/sjstest/jvm/src/test/scala/JvmTest.scala index be2bc649..b5f3ed9e 100644 --- a/src/sbt-test/scoverage/scalajs/sjstest/jvm/src/test/scala/JvmTest.scala +++ b/src/sbt-test/scoverage/scalajs/sjstest/jvm/src/test/scala/JvmTest.scala @@ -1,11 +1,9 @@ -import org.scalatest.flatspec.AnyFlatSpec -import org.scalatest.matchers.should.Matchers +import munit.FunSuite -class JvmTest extends AnyFlatSpec with Matchers { +class JvmTest extends FunSuite { - "JVM UnderTest" should "work on JVM" in { - UnderTest.jvmMethod shouldBe "jvm" + test("JVM UnderTest work on JVM") { + assertEquals(UnderTest.jvmMethod, "jvm") } } - diff --git a/src/sbt-test/scoverage/scalajs/sjstest/shared/src/test/scala/SharedTest.scala b/src/sbt-test/scoverage/scalajs/sjstest/shared/src/test/scala/SharedTest.scala index 8336af72..bbc145ae 100644 --- a/src/sbt-test/scoverage/scalajs/sjstest/shared/src/test/scala/SharedTest.scala +++ b/src/sbt-test/scoverage/scalajs/sjstest/shared/src/test/scala/SharedTest.scala @@ -1,10 +1,9 @@ -import org.scalatest.flatspec.AnyFlatSpec -import org.scalatest.matchers.should.Matchers +import munit.FunSuite -class SharedTest extends AnyFlatSpec with Matchers { +class SharedTest extends FunSuite { - "Shared UnderTest" should "return where it works" in { - UnderTest.onJsAndJvm shouldBe "js and jvm" + test("Shared UnderTest return where it works") { + assertEquals(UnderTest.onJsAndJvm, "js and jvm") } } diff --git a/src/sbt-test/scoverage/scalajs/test b/src/sbt-test/scoverage/scalajs/test index 6e6be49f..f6c10798 100644 --- a/src/sbt-test/scoverage/scalajs/test +++ b/src/sbt-test/scoverage/scalajs/test @@ -3,9 +3,9 @@ > coverage > test # There should be scoverage-data directory -$ exists sjstest/js/target/scala-2.12/scoverage-data -$ exists sjstest/jvm/target/scala-2.12/scoverage-data +$ exists sjstest/js/target/scala-2.13/scoverage-data +$ exists sjstest/jvm/target/scala-2.13/scoverage-data > coverageReport # There should be scoverage-report directory -$ exists sjstest/js/target/scala-2.12/scoverage-report -$ exists sjstest/jvm/target/scala-2.12/scoverage-report +$ exists sjstest/js/target/scala-2.13/scoverage-report +$ exists sjstest/jvm/target/scala-2.13/scoverage-report