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?

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

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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