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 builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |