An extensive test suite is essential when maintaining a non-trivial code base over time. This series of episodes looks at various aspects of testing in Clojure, as well interesting libraries to add to your toolbox.
Generative testing, also called Property Based testing, is a powerful technique able to expose some of the most obscure bugs. You’ll learn how to create and compose generators, and how to define properties that together can verify many aspects of your code.
Learn how to use a headless web browser to test your application for feature completeness. You’ll also see how Component can be used to set up an isolated test environment, how to use fixtures and dynamic var bindings to share setup code between tests, and how to keep tests readable and concise by judicously pulling code into helper functions.
Learn how to run tests with Figwheel, PhantomJS, Node, doo, and Karma.
Testing libraries and frameworks are indispensable, but there’s no magic to how
they work. Through implementing your own mini testing framework, you’ll learn
clojure.test does things under the hood.
While the main plot demonstrates how to write a function test-first, you’ll also
meet several supporting characters, like preconditions, dynamic bindings, and
even a macro. Finally the mask comes off. It was
clojure.test all this time!