@trinity You might want to consider adding https://github.com/clojure-expectations/clojure-test to your project since then you could do
(deftest pangram-1-test
(testing "is the given string a pangram according to pangram-1 fn?"
(expect true? (from-each [p pangrams] (pangram-1? p)))
(expect false? (from-each [n not-pangrams] (pangram-1? n)))))
(edited to correct from-each
call after looking at the docs!)I'd probably write it like this tho'
(defexpect pangram-1-test
(expecting "is the given string a pangram according to pangram-1 fn?"
(expect pangram-1? (from-each [p pangrams] p))
(expect (complement pangram-1?) (from-each [n not-pangrams] n))))
(partly because I prefer the "expect predicate" version of tests mostly)
@aisamu + @seancorfield thanks!! i’ve been writing clojure a few years but only started writing tests in it recently, yr suggestions are much appreciated!
Hi guys, What do you use to integration test? for example, services, controller
I use the same libs as for "unit testing": clojure.test
+ expectations/clojure-test
(to add more expressive assertions to clojure.test
).
We also do some integration testing generatively (by generating "known" combinations of actions that should lead to specific observable outcomes).