Pat*_*tty 2 scala functional-testing sbt playframework
我正在从 Java 过渡到 scala,并且正在关注https://medium.com/@geovannyjs/function-tests-with-scala-sbt-play-framework-specs2-and-one-application-per-test-suite-22ddf70e5cbe编写我的初始功能测试。
我的测试进展顺利,除了没有调用本文档末尾描述的 setup() 和 cleanup()部分。因此,按照文档,添加:
Test / fork := false
Test / testOptions += Tests.Setup(_.loadClass("common.Resources").getMethod("setup").invoke(null))
Test / testOptions += Tests.Cleanup(_.loadClass("common.Resources").getMethod("cleanup").invoke(null))
Run Code Online (Sandbox Code Playgroud)
在我的build.sbt中。之后我开始收到编译错误:
error: value / is not a member of sbt.Configuration
Run Code Online (Sandbox Code Playgroud)
在
Test / fork := false
Run Code Online (Sandbox Code Playgroud)
我可以了解我做错了什么吗?
这是我正在使用的库:
lazy val thirdPartyDependencies = Seq(
jdbc,
"com.typesafe.play" %% "anorm" % "2.4.0",
"com.typesafe.play" %% "play-mailer" % "3.0.1",
"com.microsoft.sqlserver" % "mssql-jdbc" % "6.4.0.jre8",
"io.swagger" %% "swagger-play2" % "1.5.0", // This version adds Play 2.4 support.
// ScalaTest+ Play (have to use non-release 1.4.0-M4 version for now as it is only compatible with Play 2.4)
"org.scalatestplus" %% "play" % "1.4.0-M4" % "test",
"org.mockito" % "mockito-core" % "1.10.19" % "test",
specs2 % Test
)
Run Code Online (Sandbox Code Playgroud)
您可能使用的是旧版本的 SBT,它不支持此语法。
设置sbt.version为project/build.properties某个 1.1+ 版本或使用旧语法:
fork in Test := false
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
722 次 |
| 最近记录: |