Artboard
Classic Docs
Docs Navigation

Clojure Testing Libraries

# clojure.test

Clojure is shipped with clojure.test library with basic features for writing tests. Most projects will only need to run lein test as their build command. The dependencies will be automatically pulled the first time and cached for later reuse.

# Expectations

Expectations is described as "a minimalist's unit testing framework" with the slogan "adding signal, removing noise".

Easiest way to get started is to add expectations and lein-expectations to your project.clj:

(defproject expectations-playground "0.1.0-SNAPSHOT"
  :description "Playground for exploring Expectations"
  :license {:name "Eclipse Public License"
  :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                [expectations "2.0.9"]]
  :plugins [[lein-expectations "0.0.8"]])

After that, you can run tests with lein expectations:

If you use both clojure.test and Expectations in your project, you can run tests with lein test as it will run both clojure.test and Expectations tests.

Semaphore Docs are open source — Edit on GitHub

Newsletter

Occasional lightweight product and blog updates. Unsubscribe at any time.

2009-2020 © Rendered Text. All rights reserved. Terms of Service, Privacy policy, Security.