The Clojure Unit Test Library

Take a deep dive into the clojure.test fundamental library, which we use to create unit tests in Clojure.

Unit testing in Clojure

Unit testing is about testing the smallest unit of code. In functional languages, the unit is typically the function, which is true in Clojure.

In Clojure, we have a few frameworks that can help us do unit testing. However, because we’re here to explore the core functionalities, we’re only going to talk about clojure.test, which is one of the fundamental core libraries and the one that will ensure we do a really good job in testing.

The clojure.test library

This is a unit testing framework available in Clojure that can be imported into the desired namespace, like this:

Get hands-on with 1200+ tech skills courses.