How do I get a list of unit tests in clojure? -
i using deftest define unit tests (the tests generated macro, why identifiers qualified):
(clojure.test/deftest init-globals-test (clojure.test/is (clojure.core/= 40 casc-gen-org.dev/*board-width*)) (clojure.test/is (clojure.core/= 40 casc-gen-org.dev/*board-height*)))
however when run tests:
(run-tests)
i following:
: #'casc-gen-org.dev/clj-run-runtime-uts{:type :summary, :fail 0, :error 0, :pass 6, :test 3}
it says have 3 tests , 6 assertions (assuming i'm reading right), expected 1 test , 2 assertions. assume have stale tests in repl somwhere , i'd delete them.
i looked @ doc deftest (https://clojure.github.io/clojure/clojure.test-api.html) , don't see related listing tests.
how list tests defined?
clojure.test
manual search / filter find vars :test
metadata, , vars found metadata key considered tests. can same, , list vars considered unit tests small function of no arguments:
#(->> (all-ns) (mapcat (comp vals ns-interns)) (filter (comp :test meta)))
Comments
Post a Comment