0

lein-cucumber用来写黄瓜测试。我的测试套件执行时没有任何错误,但我的 IDE 标记了这些警告:

  • 给定无法解决。
  • 然后无法解决。
  • 未定义的步骤参考:...

在此处输入图像描述 在此处输入图像描述

我已经安装了插件:cursivecucumberIntellij gherkin。但是这些警告仍然显示。

这是我的 project.clj 文件:

(defproject app version
  :dependencies [
  [org.clojure/clojure "1.8.0"]
  [org.clojure/tools.logging "0.4.0"]
  [org.clojure/tools.cli "0.3.5"]
  [org.clojure/data.json "0.2.6"]
  [clj-http "3.9.1"]
  [mysql/mysql-connector-java "5.1.38"]
  [org.slf4j/slf4j-log4j12 "1.7.25"]
  [log4j/log4j "1.2.17" :exclusions [javax.mail/mail
  javax.jms/jms
  com.sun.jmdk/jmxtools
  com.sun.jmx/jmxri]]
  [metosin/compojure-api "1.1.11"]
  [metosin/ring-swagger "0.24.3"]
  [compojure "1.6.0"]
  [cheshire "5.8.0"]
  [ring "1.6.3"]
  [ring/ring-json "0.4.0"]
  [ring-logger "0.7.7"]
  [environ "1.1.0"]
  [korma "0.4.3"]
  [blackwater "0.0.9"]
  [prismatic/schema "1.1.7"]
  [siili/humanize "0.1.1"]
  [amazonica "0.3.117"]
  [clj-time "0.14.2"]
  [ring-cors "0.1.12"]
  [commons-io "2.0"]
  ]

  :plugins      [
  [lein-ring "0.12.1"]
  [lein-cucumber "1.0.2"]
  [lein-cloverage "1.0.10"]
  [lein-kibit "0.1.6"]
  [lein-cloverage "1.0.10"]
  [lein-try "0.4.3"]
  [nightlight/lein-nightlight "1.0.0"]
  [jonase/eastwood "0.2.3"]
  [cider/cider-nrepl "0.16.0"]
  ]

  :min-lein-version "2.5.3"

  :ring {:handler app.api.handler/app}

  :source-paths ["src"]

  :resource-paths ["resources"]

  :test-paths ["test/unit"
  "test/features"]

  :cucumber-feature-paths ["test/features"]

  :profiles {:uberjar {:aot :all}}
  )
4

1 回答 1

2

当使用动态定义变量/函数的库时,可能会发生这种情况。Cursive 无法发现这些定义,因为它需要评估生成定义的代码。

Given看看如何定义似乎就是这种情况。我还在 Amazonica 等库中看到了这一点,这些库基于 AWS 开发工具包生成定义。

于 2019-03-07T15:03:43.140 回答