(call f n)
Get the call map for the nth call
Get the call map for the nth call
(call-count f)
The number of times the spied function has been called
The number of times the spied function has been called
(called-once? f)
Has the spied function been called once?
Has the spied function been called once?
(called-with? f args)
Has the spied function been called with these args?
Has the spied function been called with these args?
(called? f)
Has the spied function been called?
Has the spied function been called?
(calls f)
Returns a seq of call maps, one per call. Each map contains the keys :args and :return or :throw
Returns a seq of call maps, one per call. Each map contains the keys :args and :return or :throw
(spy f)
wrap f, returning a new fn that keeping track of its call count and arguments
wrap f, returning a new fn that keeping track of its call count and arguments
(with-fakes setup & body)
Takes a map of fn vars to fns. Replaces each fn with the new implementation and spies the stubbed-fn
Takes a map of fn vars to fns. Replaces each fn with the new implementation and spies the stubbed-fn
(with-spies setup & body)
Takes a vector of fn vars (vars that resolve to fns). Modifies the fn to track call counts, but does not change the fn's behavior
Takes a vector of fn vars (vars that resolve to fns). Modifies the fn to track call counts, but does not change the fn's behavior
(with-stubs setup & body)
Can either take a vector of fn vars, or a map of fn vars to return values. Replaces each fn with one that takes any number of args and returns nil or the mapped return value. Also spies the stubbed-fn
Can either take a vector of fn vars, or a map of fn vars to return values. Replaces each fn with one that takes any number of args and returns nil or the mapped return value. Also spies the stubbed-fn
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close