Eftest is a fast and pretty Clojure test runner.
To install, add the following to your project :dependencies
:
[eftest "0.1.1"]
When all the tests pass, it looks like this:
When a test fails, it looks like:
And when a test throws an exception, it looks like:
Eftest has two main functions: find-tests
and run-tests
.
The find-tests
function searches a source, which can be a namespace,
directory path, symbol, var, or a collection of any of the previous.
It returns a collection of test vars found in the source.
The run-tests
function accepts a collection of test vars and runs
them, delivering a report on the tests as it goes.
Typically these two functions are used together:
user=> (require '[eftest.runner :refer [find-tests run-tests]])
nil
user=> (run-tests (find-tests "test"))
...
The above example will run all tests found in the "test" directory.
By default Eftest runs tests in parallel, which can cause issues with tests that expect to be single-threaded. To disable this:
user=> (run-tests (find-tests "test") {:multithread? false})
You can also change the reporting function used. For example, if you want a colorized reporter but without the progress bar:
user=> (run-tests (find-tests "test") {:report eftest.report.pretty/report})
Or maybe you want the old Clojure test reporter:
user=> (run-tests (find-tests "test") {:report clojure.test/report})
Copyright © 2015 James Reeves
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.