Scala测试错误:value /不是sbt.Configuration的成员

问题描述 投票:0回答:1

我正在从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 )

scala playframework sbt functional-testing
1个回答
1
投票
您可能正在使用不支持此语法的SBT的旧版本。

sbt.version中的project/build.properties设置为1.1+版本或使用较旧的语法:

fork in Test := false

© www.soinside.com 2019 - 2024. All rights reserved.