cljs.spec.test/check-var
function | removed v1.9.183 | added v1.9.14 | Edit |
(check-var v & opts)
Source docstring:
Checks a var's specs using test.check. Optional args are
passed through to test.check/quick-check:
num-tests number of tests to run, default 100
seed random seed
max-size how large an input to generate, max 200
reporter-fn reporting fn
Returns a map as quick-check, with :explain-data added if
:result is false.
(defn check-var
[v & opts]
(let [fnspec (spec/get-spec v)]
(if (:args fnspec)
(apply check-fn @v fnspec opts)
(throw (js/Error. (str "No :args spec for " v))))))