Run tests from Clojure Repl and Leiningen

Start a REPL with lein repl, then use require

(require '[clojure.test :refer [run-tests]])
(require 'your-ns.example-test :reload-all)
(run-tests 'your-ns.example-test)

I prefer to stay in the user namespace, as opposed to changing it with in-ns as mentioned by another answer. Instead, pass the namespace as an argument to run-tests (as shown above).

I’d also recommend staying away from (use 'clojure.test); that is why I suggested (require '[clojure.test :refer [run-tests]]) above. For more background, read http://dev.clojure.org/jira/browse/CLJ-879

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)