Is there a way, via cider or some other emacs extension, to run all of the tests in a leiningen project?

cider has the function cider-test-run-tests which attempts to just run the tests related to the code in the current buffer. That's fine, but often I want to run all of the tests in a project. (In fact, I'd like to run this all the time while editing.) I can't seem to find a simple way to say "find all of the tests in this project and run them."

Does anyone know how to do this?

3 Answers 3


Unfortunately there is not a way to do this currently in cider.

One would have to write a custom command to evaluate clojure.tests/run-all-tests (or clojure.tests/run-tests with a list of namespaces as arguments).


there is an option to run all the tests in all the projects namespaces

M-x cider-test-run-project-tests or C-c C-t C-p

Here is the link to additional options for running tests



You can do this if you use lein-test-refresh and compile.

This is a function that I use with it. I'm getting system notifications so I bury the buffer.

(defun lein-test()
  (compile "lein test-refresh")
   (get-buffer "*compilation*"))
  (rename-buffer "*lein-test*")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.