Skip to content

Instantly share code, notes, and snippets.

@samedhi
Created September 12, 2018 03:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samedhi/8ce34d1ebc588877a33b6df5e3013140 to your computer and use it in GitHub Desktop.
Save samedhi/8ce34d1ebc588877a33b6df5e3013140 to your computer and use it in GitHub Desktop.
(ns example.test-utils
(:require
[clojure.spec.test.alpha :as spec.test]
[cljs.test :as test :include-macros true]))
(defmacro deftest-fdef [sym]
`(test/deftest ~(-> sym name (str "-test") symbol)
(let [[res#] (spec.test/check (quote ~sym))
{{result# :result :as ret#} :clojure.spec.test.check/ret} res#]
(-> ret#
clojure.pprint/pprint
println)
(test/is (true? result#)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment