clojure.test is the default 'unit' testing framework for Clojure, as it has a simple syntax for writing tests and it is part of the Clojure.core library.
(deftest public-function-in-namespace-test (testing "A description of the test" (is (= 1 (public-function arg))) (is (predicate-function? arg))))
For full details, visit the API for
Running tests in Cider
|Spacemacs||Vim Major mode||Emacs Major mode||command|
Tests can be run from a Clojure buffer containing the test code itself, or from the Clojure source code (in which case CIDER will look up the corresponding test namespace).
Tests can also be run from the REPL buffer, using the
Auto Test Mode
, T tto toggle auto test mode
after which you can just
, e b and it will automatically run tests every time.
by re-evaluating the buffer with auto test mode on it to automatically run tests whenever that namespace is loaded.