cljs.test/deftest
(deftest name & body)
Source docstring:
Defines a test function with no arguments. Test functions may call
other tests, so tests may be composed. If you compose tests, you
should also define a function named test-ns-hook; run-tests will
call test-ns-hook instead of testing all vars.
Note: Actually, the test body goes in the :test metadata on the var,
and the real function (the value of the var) calls test-var on
itself.
When cljs.analyzer/*load-tests* is false, deftest is ignored.
(defmacro deftest
[name & body]
(when ana/*load-tests*
`(do
(def ~(vary-meta name assoc :test `(fn [] ~@body))
(fn [] (cljs.test/test-var (.-cljs$lang$var ~name))))
(set! (.-cljs$lang$var ~name) (var ~name)))))