(deftest name & body)
Declares a test function as done by clojure.test/deftest
with built-in
support for mocking through (optional) providing
and verifying
forms.
(deftest test-name
; test code
(providing
; one or more entries in the form:
; (fn-name &args) return-value
...)
(verifying
; one or more entries in the form:
; (fn-name &args) return-value call-count-matcher
...)
Example:
(deftest test-name
(is (= :ret-val (one-fn)))
(providing
(one-fn) :ret-val))
Declares a test function as done by `clojure.test/deftest` with built-in support for mocking through (optional) `providing` and `verifying` forms. ``` (deftest test-name ; test code (providing ; one or more entries in the form: ; (fn-name &args) return-value ...) (verifying ; one or more entries in the form: ; (fn-name &args) return-value call-count-matcher ...) ``` Example: ``` (deftest test-name (is (= :ret-val (one-fn))) (providing (one-fn) :ret-val)) ```
(testing string & body)
Declares a new testing context inside a test function as done by
clojure.test/testing
with built-in support for mocking through (optional)
providing
and verifying
forms.
(testing "description"
; test code
(providing
; one or more entries in the form:
; (fn-name &args) return-value
...)
(verifying
; one or more entries in the form:
; (fn-name &args) return-value call-count-matcher
...)
Example:
(deftest test-name
(testing "context"
(is (= :ret-val (one-fn)))
(verifying
(one-fn) :ret-val (mockfn.matchers/exactly 1))))
Declares a new testing context inside a test function as done by `clojure.test/testing` with built-in support for mocking through (optional) `providing` and `verifying` forms. ``` (testing "description" ; test code (providing ; one or more entries in the form: ; (fn-name &args) return-value ...) (verifying ; one or more entries in the form: ; (fn-name &args) return-value call-count-matcher ...) ``` Example: ``` (deftest test-name (testing "context" (is (= :ret-val (one-fn))) (verifying (one-fn) :ret-val (mockfn.matchers/exactly 1)))) ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close