Using cider-test with Alternative Test Libraries

The clojure.test machinery is designed to be pluggable. Any test library can integrate with it and leverage the cider-test ecosystem.

As a test framework author, supporting the built-in clojure.test machinery (and hence cider-test) is pretty straightforward:

  1. Add :test metadata to the vars corresponding to the test functions. The clojure-test machinery uses this metadata to find tests.

  2. Implement the clojure.test/report multimethod to capture the test results.

For example, test.check was designed independently of clojure.test but integrates with it. Because of this, cider-test handles defspec just like deftest. test.check just adds compatibility in this namespace.

Supported Libraries

Midje Support

Emidje is a third-party extension that’s not bundled with CIDER.

Emidje is a test runner, report viewer and formatting tool for Midje within Emacs.

Emidje extends CIDER to provide support for Midje tests in a similar fashion as cider-test.el does for clojure.test tests. In fact, most of Emidje’s functionalities were strongly inspired by cider-test.el features.