practicalli / clojure-web-services

Develop production grade server-side web services and APIs using Clojure and REPL driven development
https://practical.li/clojure-web-services
Creative Commons Attribution Share Alike 4.0 International
11 stars 14 forks source link

refine test speed using transaction rollback #73

Open practicalli-johnny opened 3 years ago

practicalli-johnny commented 3 years ago

Use transaction rollback so any database updated done by the unit tests is not committed permanently.

Create two fixtures, :once drop/create database :every run tests in transaction

The transaction is set to rollback regardless, leaving the database in the previous state (just the empty database tables)

https://purelyfunctional.tv/mini-guide/clojure-database-test-faster/