5

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?

abingham
  • 927
  • 6
  • 18

3 Answers3

2

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

http://cider.readthedocs.org/en/latest/extended_workflow/#running-tests

Chakkakuru
  • 66
  • 4
1

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).

verdammelt
  • 367
  • 3
  • 10
0

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()
  (interactive)
  (compile "lein test-refresh")
  (pop-to-buffer
   (get-buffer "*compilation*"))
  (rename-buffer "*lein-test*")
  (delete-window))
Scott Weldon
  • 2,695
  • 1
  • 17
  • 31
Vargonaut
  • 1
  • 1