This library is a subset of
clojure.test for Clojure and ClojureScript. It
lets you write tests (albeit with constraints) that can run on both Clojure and
You can also use this library to write JVM-specific and CLJS-specific tests.
For ClojureScript testing this library should be used in conjunction with lein-cljsbuild.
On Clojars: On Clojars: https://clojars.org/clip-test
Supported Clojure versions: 1.2, 1.3, 1.4, 1.5
Tested with lein-cljsbuild version: 0.2.9
ismacros are supported.
thrown-with-msg?are implemented as macros; unlike
clojure.test, there is no multi-method to extend the dispatch on.
- You must implement the
test-ns-hookfunction in the test namespace and call it externally to run the tests in CLJS.
- Write the tests in the same style as in
- Invoke the tests in CLJS in a way similar as in
- You need to have PhantomJS (
run-tests.js) and/or Firefox+Firebug (
- The namespaces
clip-test.testutil-cljshave common functions that provide similar functionality in Clojure and ClojureScript.
The following projects use clip-test for CLJS testing:
Development of this library
Clean old stuff if required (esp for ClojureScript testing):
lein clean lein dev cljsbuild clean
Run the tests (you may see failures and errors - they are expected):
lein dev test # test with latest stable Clojure version lein dev cljsbuild test # test with ClojureScript (needs `phantomjs` installed) lein all test # test with all supported Clojure versions
Building the JAR
Clean old stuff if required (see 'Running tests' section above.) Then run this:
lein jar # create the JAR file lein install # install JAR to local Maven repo
Getting in touch
On Twitter: @kumarshantanu
E-mail: kumar(dot)shantanu at gmail.com
Copyright © 2012 Shantanu Kumar
Distributed under the Eclipse Public License, the same as Clojure.