Generates human-readable errors for clojure.spec
Generates human-readable errors for `clojure.spec`
(custom-printer opts)
Returns a printer.
Options:
:show-valid-values?
- if false
, replaces valid values with "...":value-str-fn
- function to print bad values:print-specs?
- if true
, display "Relevant specs" section. Otherwise, omit that section.:theme
- enables color theme. Possible values: :figwheel-theme
, :none
Returns a printer. Options: - `:show-valid-values?` - if `false`, replaces valid values with "..." - `:value-str-fn` - function to print bad values - `:print-specs?` - if `true`, display "Relevant specs" section. Otherwise, omit that section. - `:theme` - enables color theme. Possible values: `:figwheel-theme`, `:none`
(def k spec-form)
(def k spec-form error-message)
DEPRECATED: Prefer defmsg
Define a spec with an optional error-message
.
Replaces clojure.spec.alpha/def
but optionally takes a human-readable error-message
(will only be used for predicates) e.g. "should be a string".
DEPRECATED: Prefer `defmsg` Define a spec with an optional `error-message`. Replaces `clojure.spec.alpha/def` but optionally takes a human-readable `error-message` (will only be used for predicates) e.g. "should be a string".
(defmsg k error-message)
Associates the spec named k
with error-message
.
Associates the spec named `k` with `error-message`.
(error-message k)
Given a spec named k
, return its human-readable error message.
Given a spec named `k`, return its human-readable error message.
(explain-result check-result)
Given a result from clojure.spec.test.alpha/check
, prints a summary of the result.
Given a result from `clojure.spec.test.alpha/check`, prints a summary of the result.
(explain-result-str check-result)
Given a result from clojure.spec.test.alpha/check
, returns a string summarizing the result.
Given a result from `clojure.spec.test.alpha/check`, returns a string summarizing the result.
(explain-results check-results)
Given a sequence of results from clojure.spec.test.alpha/check
, prints a summary of the results.
Given a sequence of results from `clojure.spec.test.alpha/check`, prints a summary of the results.
(explain-results-str check-results)
Given a sequence of results from clojure.spec.test.alpha/check
, returns a string summarizing the results.
Given a sequence of results from `clojure.spec.test.alpha/check`, returns a string summarizing the results.
(expound spec form)
Given a spec
and a form
, either prints a success message or a human-readable error message.
Given a `spec` and a `form`, either prints a success message or a human-readable error message.
(expound-str spec form)
Given a spec
and a form
, either returns success message or a human-readable error message.
Given a `spec` and a `form`, either returns success message or a human-readable error message.
(printer explain-data)
Prints explain-data
in a human-readable format.
Prints `explain-data` in a human-readable format.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close