clojure
clojure copied to clipboard
Human readable Spec messages
TODOL create a section on understanding spec error messages
A section on improving spec error message Expound formats clojure.spec error messages in a way that is optimized for humans to read.
https://github.com/bhb/expound
For example, Expound will replace a clojure.spec error message like:
val: {} fails spec: :example/place predicate: (contains? % :city)
val: {} fails spec: :example/place predicate: (contains? % :state)
with
-- Spec failed --------------------
{}
should contain keys: :city, :state
| key | spec |
|========+=========|
| :city | string? |
|--------+---------|
| :state | string? |