diff --git a/build.sbt b/build.sbt index 88d6c61..a64b79f 100644 --- a/build.sbt +++ b/build.sbt @@ -3,10 +3,9 @@ import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType} val Leaf = "0.1.0" val Scala2_11 = "2.11.12" -val Scala2_12 = "2.12.8" -val Scala2_13 = "2.13.0" -val ScalaTest = "3.0.8" -val ScalaTestNative = "3.2.0-SNAP10" +val Scala2_12 = "2.12.12" +val Scala2_13 = "2.13.3" +val ScalaTest = "3.2.2" val SharedSettings = Seq( name := "trail", @@ -51,19 +50,14 @@ lazy val trail = crossProject(JSPlatform, JVMPlatform, NativePlatform) .settings( autoAPIMappings := true, apiMappings += (scalaInstance.value.libraryJar -> url(s"http://www.scala-lang.org/api/${scalaVersion.value}/")), - ) - .jsSettings( - libraryDependencies += "org.scalatest" %%% "scalatest" % ScalaTest % "test" - ) - .jvmSettings( - libraryDependencies += "org.scalatest" %%% "scalatest" % ScalaTest % "test" + libraryDependencies ++= Seq("freespec", "wordspec", "funspec", "funsuite", "shouldmatchers").map(module => + "org.scalatest" %%% s"scalatest-$module" % ScalaTest % Test + ) ).nativeSettings( scalaVersion := Scala2_11, crossScalaVersions := Seq(Scala2_11), // See https://github.com/scalalandio/chimney/issues/78#issuecomment-419705142 - nativeLinkStubs := true, - libraryDependencies += - "org.scalatest" %%% "scalatest" % ScalaTestNative % "test" + Test / nativeLinkStubs := true ) lazy val manual = project.in(file("manual")) diff --git a/project/build.properties b/project/build.properties index c0bab04..0837f7a 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.2.8 +sbt.version=1.3.13 diff --git a/project/plugins.sbt b/project/plugins.sbt index cc949ac..938f5c5 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ logLevel := Level.Warn -addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0") -addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "0.6.0") +addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0") +addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.0.0") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.28") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.9") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.0-M2") diff --git a/shared/src/test/scala/trail/PathTests.scala b/shared/src/test/scala/trail/PathTests.scala index 763a928..9641ed7 100644 --- a/shared/src/test/scala/trail/PathTests.scala +++ b/shared/src/test/scala/trail/PathTests.scala @@ -1,8 +1,8 @@ package trail -import org.scalatest._ +import org.scalatest.funsuite.AnyFunSuite -class PathTests extends FunSuite { +class PathTests extends AnyFunSuite { test("Parse absolute URL") { assert(PathParser.parse("http://example.com/test") == Path("/test")) } diff --git a/shared/src/test/scala/trail/RouteDataTests.scala b/shared/src/test/scala/trail/RouteDataTests.scala index f5e3f31..56cdbc9 100644 --- a/shared/src/test/scala/trail/RouteDataTests.scala +++ b/shared/src/test/scala/trail/RouteDataTests.scala @@ -1,8 +1,9 @@ package trail -import org.scalatest._ +import org.scalatest.wordspec.AnyWordSpec +import org.scalatest.matchers.should.Matchers -class RouteDataTests extends WordSpec with Matchers { +class RouteDataTests extends AnyWordSpec with Matchers { "A Route" when { "empty" should { "return root URL" in { diff --git a/shared/src/test/scala/trail/RouteEqualityTests.scala b/shared/src/test/scala/trail/RouteEqualityTests.scala index f393a50..66b5b77 100644 --- a/shared/src/test/scala/trail/RouteEqualityTests.scala +++ b/shared/src/test/scala/trail/RouteEqualityTests.scala @@ -1,8 +1,8 @@ package trail -import org.scalatest._ +import org.scalatest.freespec.AnyFreeSpec -class RouteEqualityTests extends FreeSpec with Matchers { +class RouteEqualityTests extends AnyFreeSpec { "A Route" - { "cannot equal InstantiatedRoute" in { val r1 = Root / "asdf" diff --git a/shared/src/test/scala/trail/RouteFragmentTests.scala b/shared/src/test/scala/trail/RouteFragmentTests.scala index b2ddc0d..929f8f7 100644 --- a/shared/src/test/scala/trail/RouteFragmentTests.scala +++ b/shared/src/test/scala/trail/RouteFragmentTests.scala @@ -1,9 +1,9 @@ package trail -import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec import trail.Route.ParamRoute0 -class RouteFragmentTests extends FunSpec with Matchers { +class RouteFragmentTests extends AnyFunSpec { it("Define route with fragment") { val route = Root $ Fragment[String] assert(route.route == Root) diff --git a/shared/src/test/scala/trail/RouteParamTests.scala b/shared/src/test/scala/trail/RouteParamTests.scala index 183edbc..ae1fa87 100644 --- a/shared/src/test/scala/trail/RouteParamTests.scala +++ b/shared/src/test/scala/trail/RouteParamTests.scala @@ -1,8 +1,9 @@ package trail -import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers -class RouteParamTests extends FunSpec with Matchers { +class RouteParamTests extends AnyFunSpec with Matchers { import Route._ it("Define route with one parameter") { diff --git a/shared/src/test/scala/trail/RouteParseTests.scala b/shared/src/test/scala/trail/RouteParseTests.scala index 02a9097..dec9a90 100644 --- a/shared/src/test/scala/trail/RouteParseTests.scala +++ b/shared/src/test/scala/trail/RouteParseTests.scala @@ -1,10 +1,11 @@ package trail -import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.matchers.should.Matchers import scala.util.Try -class RouteParseTests extends FunSpec with Matchers { +class RouteParseTests extends AnyFunSpec with Matchers { it("Parse root") { val root = Root assert(root.parseArgs("/").contains(())) diff --git a/shared/src/test/scala/trail/RoutingTableTests.scala b/shared/src/test/scala/trail/RoutingTableTests.scala index fc31858..07c661a 100644 --- a/shared/src/test/scala/trail/RoutingTableTests.scala +++ b/shared/src/test/scala/trail/RoutingTableTests.scala @@ -1,8 +1,8 @@ package trail -import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec -class RoutingTableTests extends FunSpec with Matchers { +class RoutingTableTests extends AnyFunSpec { it("Express a routing table with pattern matching") { val details = Root / "details" / Arg[Int] val userInfo = Root / "user" / Arg[String] / Arg[Boolean] diff --git a/shared/src/test/scala/trail/UrlTests.scala b/shared/src/test/scala/trail/UrlTests.scala index fbf844b..e9e4c9c 100644 --- a/shared/src/test/scala/trail/UrlTests.scala +++ b/shared/src/test/scala/trail/UrlTests.scala @@ -1,8 +1,10 @@ package trail -import org.scalatest._ +import org.scalatest.funspec.AnyFunSpec +import org.scalatest.wordspec.AnyWordSpec +import org.scalatest.matchers.should.Matchers -class UrlTests extends WordSpec with Matchers { +class UrlTests extends AnyWordSpec with Matchers { "A Route" when { "empty" should { "create root" in { @@ -108,7 +110,7 @@ class UrlTests extends WordSpec with Matchers { } } -class UrlTests2 extends FunSpec with Matchers { +class UrlTests2 extends AnyFunSpec { it("url() work with mandatory arguments") { val userInfo = Root / "user" / Arg[String] / Arg[Boolean]