【问题标题】:How to make Clojure tests stop tests running in case one of them failed?如果其中一个测试失败,如何让 Clojure 测试停止运行?
【发布时间】:2019-07-30 13:21:33
【问题描述】:

我只想让命令lein test 在第一个测试用例失败后正确失败。

【问题讨论】:

    标签: clojure leiningen


    【解决方案1】:

    不是一个确切的答案,但如果您正在处理一个有问题的测试,我会使用 lein-test-refresh 的“焦点”功能。很酷的插件。

    https://github.com/jakemcc/lein-test-refresh

    【讨论】:

      【解决方案2】:

      我使用eftest 作为默认clojure.test runner 的更好替代方案:

      如何使用?

      来自 REPL https://github.com/weavejester/eftest#fast-failure

      user=> (run-tests (find-tests "test") {:fail-fast? true})
      

      或使用 lein 插件https://github.com/weavejester/eftest#plugin

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2021-09-17
        • 2021-04-17
        • 1970-01-01
        • 1970-01-01
        • 2016-01-24
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多