May 2018
Beginner to intermediate
290 pages
6h 43m
English
So far we have run our tests one at a time, but this gets old fast. Happily, clojure.test provides the run-tests function, which makes it easy to run all of the tests in a namespace:
| | ;; Three ways to run the tests in a namespace. |
| | |
| | (test/run-tests) |
| | (test/run-tests *ns*) |
| | (test/run-tests 'inventory.core-test) |
Call run-tests without any arguments, and it will run all the tests in the current namespace. Pass it either a namespace value or a namespace name (as a symbol), and it will run all the tests in that namespace.
Better still, Leiningen provides a task to run all the tests in all the namespaces in your project from the command line:
| | $ lein test |
| | |
| | Ran 1 tests containing ... |
Read now
Unlock full access