Utilities to help emulating server responses in unit tests.
Utilities to help emulating server responses in unit tests.
(emulate-requests item f)
Returns an item that calls f
on every ajax request executed in
item
. The function may return an ajax response, in which case the
request isn't actually executed, but results in the returned response
instead.
If the function returns nil
, the request is executed as
normal. Note that this means you can pass in a map as f
, mapping
requests to responses.
Returns an item that calls `f` on every ajax request executed in `item`. The function may return an ajax response, in which case the request isn't actually executed, but results in the returned response instead. If the function returns `nil`, the request is executed as normal. Note that this means you can pass in a map as `f`, mapping requests to responses.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close