Liking cljdoc? Tell your friends :D

de.otto.tesla.util.test-utils


eventuallycljmacro

(eventually form & {:keys [timeout interval] :or {timeout 5000 interval 10}})

Generic assertion macro, that waits for a predicate test to become true. 'form' is a predicate test, that clojure.test/is can understand 'timeout': optional; in ms; how long to wait in total (defaults to 5000) 'interval' optional; in ms; how long to pause between tries (defaults to 10)

Example: Since this will fail half of the time ... (is (= 1 (rand-int 2)))

... use this: (eventually (= 1 (rand-int 2)))

Generic assertion macro, that waits for a predicate test to become true.
'form' is a predicate test, that clojure.test/is can understand
'timeout': optional; in ms; how long to wait in total (defaults to 5000)
'interval' optional; in ms; how long to pause between tries (defaults to 10)

Example:
Since this will fail half of the time ...
  (is (= 1 (rand-int 2)))

... use this:
  (eventually (= 1 (rand-int 2)))
sourceraw docstring

mock-requestclj

(mock-request method url args)

merges additional arguments into a mock-request

merges additional arguments into a mock-request
sourceraw docstring

with-startedcljmacro

(with-started bindings & body)

bindings => [name init ...]

Evaluates body in a try expression with names bound to the values of the inits after (.start init) has been called on them. Finally a clause calls (.stop name) on each name in reverse order.

bindings => [name init ...]

Evaluates body in a try expression with names bound to the values
of the inits after (.start init) has been called on them. Finally
a clause calls (.stop name) on each name in reverse order.
sourceraw docstring

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

× close