Liking cljdoc? Tell your friends :D

me.pmatiello.mockfn.clj-test


deftestcljmacro

(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))
sourceraw docstring

providingclj

source

testingcljmacro

(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))))
sourceraw docstring

verifyingclj

source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close