【问题标题】:How to run automate cljs tests in cider?如何在苹果酒中运行自动化 cljs 测试?
【发布时间】:2020-03-28 21:55:51
【问题描述】:

当我在 cider 中的 core_test.clj 文件中运行测试时,每当我加载缓冲区时,测试运行都没有问题,因为我已经设置了 (cider-auto-test-mode 1)。但这不适用于 cljs 文件。我在 core_test.cljs 中有以下代码

(ns myapp.core-test
  (:require
   [cljs.test         :refer-macros [is deftest]]))

(deftest my-test
  (testing "Arithmetic"
    (testing "with positive integers"
      (is (= 4 (+ 2 2)))
      (is (= 7 (+ 3 4))))
    (testing "with negative integers"
      (is (= -4 (+ -2 -2)))
      (is (= -1 (+ 3 -4))))))

然后在 core.cljs 中执行 C-k。测试不运行。为什么会这样?如何让 cljs 测试也像 clj 测试一样自动化?

【问题讨论】:

    标签: testing clojure clojurescript


    【解决方案1】:

    在我看来它还不支持。来自CIDER docs for ClojureScript

    CIDER 与 ClojureScript 配合得很好,但并非所有 CIDER 功能都在 ClojureScript 中可用(目前)。例如,测试运行器和调试器目前是 Clojure 独有的功能。

    还有其他选项可以在命令行中自动运行 CLJS 测试,例如,使用 FigwheelShadow CLJScljs-test-runner

    【讨论】:

      猜你喜欢
      • 2015-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多