【问题标题】:Play 2.1 sbt-jasmine-plugin getting not found: value jasmineSettings error播放 2.1 sbt-jasmine-plugin 找不到:值 jasmineSettings 错误
【发布时间】:2014-03-11 05:02:02
【问题描述】:

我正在尝试将 jasmine 测试与 play build 集成。

我在这篇博文 (http://perevillega.com/post/2013/01/26/26/executing-jasmine-tests-in-play-204/) 中从监护人 (https://github.com/barnesjd/sbt-jasmine-plugin) 那里找到了 sbt-jasmine-plugin

由于博文中使用的版本,我按照这些步骤进行了一些(我相信)细微修改。

例如,我的 project/project/Plugins.scala 文件中有这个

object Plugins extends Build {
    lazy val plugins = Project("plugins", file("."))
    //.dependsOn(uri("git://github.com/guardian/sbt-jasmine-plugin.git#1.1"))
    .dependsOn(uri("git://github.com/guardian/sbt-jasmine-plugin.git#0.7"))
}

我已经尝试了两个版本的插件,来自 github 的最新版本和帖子中使用的版本。

至于我的项目/Build.scala 文件,我有这个

val main = play.Project(appName, appVersion, appDependencies)
seq(jasmineSettings : _*)
//.settings(jasmineSettings : _*)  //this adds jasmine settings from the sbt-jasmine plugin
.settings(
  // Add your own project settings here
  // jasmine configuration, overridden as we don't follow the default project structure sbt-jasmine expects
  appJsDir <+= baseDirectory / "app/assets/javascripts",
  appJsLibDir <+= baseDirectory / "public/javascripts/vendor",
  jasmineTestDir <+= baseDirectory / "test/assets/",
  jasmineConfFile <+= baseDirectory / "test/assets/test.dependencies.js",

  // link jasmine to the standard 'sbt test' action. Now when running 'test' jasmine tests will be run, and if they pass
  // then other Play tests will be executed.
  (test in Test) <<= (test in Test) dependsOn (jasmine)
)

我已经尝试过 github 中使用的 seq(jasmineSettings : _) 和帖子中使用的 .settings(jasmineSettings : _)。

这两种方式总是让我遇到这个错误:

project/Build.scala:18: not found: value jasmineSettings

我运行这个

play test

我什至尝试更新依赖项,第一次运行 play test 时(在插件的每个版本上)我看到正在下载的东西,但错误总是一样的。

这个错误似乎很常见

https://github.com/guardian/sbt-jasmine-plugin/issues/2

有什么建议吗?谢谢!

【问题讨论】:

  • 您是否看到任何关于找不到插件的错误?
  • 不是真的,我第一次运行游戏测试时显示正在下载一些东西。然后错误总是一样的:未找到:value jasmineSettings。我可能会遗漏任何步骤吗?我的东西好看吗?
  • 你可以通过github等分享项目吗?
  • 不,我不能。可以在这里发私信吗?
  • 按设计,没有。 :) 但我的电子邮件在我的个人资料中。我最近接受了该插件的所有权,所以我很乐意提供帮助。

标签: scala playframework-2.0 sbt jasmine


【解决方案1】:

您的Build.scala 文件需要导入插件的命名空间,您引用的博文没有提及:

import com.gu.SbtJasminePlugin._

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-09-21
    • 1970-01-01
    • 2021-09-12
    • 1970-01-01
    • 2013-05-01
    • 2015-04-28
    • 2019-12-18
    • 2021-10-22
    相关资源
    最近更新 更多