samedi 28 mars 2020

How to run automate cljs tests in cider?

When I run tests in my core_test.clj file in cider, the tests run with no problem whenever I load a buffer, since I have set (cider-auto-test-mode 1). But this doesn't work with the cljs file. I have the following code in 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))))))

And upon doing C-k in core.cljs. The test doesn't run. Why is this and how can I make cljs tests automatic too, just like clj tests?

Aucun commentaire:

Enregistrer un commentaire