我正在从Java过渡到Scala,并且正在遵循https://medium.com/@geovannyjs/functional-tests-with-scala-sbt-play-framework-specs2-and-one-application-per-test-suite-22ddf70e5cbe t 写我的初始功能测试。
我的测试进行得很好,除了正在调用此文档末尾描述的setup()和cleanup()的部分是[[not)。因此,在文档之后,添加了:
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))
在我的中。之后,我开始得到编译错误:build.sbt
error: value / is not a member of sbt.Configuration
输入
Test / fork := false
这是我正在使用的库:我可以对我做错什么有任何了解吗?
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
)
将sbt.version
中的project/build.properties
设置为1.1+版本或使用较旧的语法:
fork in Test := false