Liking cljdoc? Tell your friends :D

donut.system.test.mock

helpers for mocking components

helpers for mocking components
raw docstring

called-with?clj

(called-with? component-id args)
(called-with? system component-id args)

check that a component fn was called with args

check that a component fn was called with args
raw docstring

called?clj

(called? component-id)
(called? system component-id)

check that a component fn was called at all

check that a component fn was called at all
raw docstring

mock-calls-pluginclj

Add MockCallsComponent to a system

Add MockCallsComponent to a system
raw docstring

MockCallsComponentclj

Records all mock calls

Records all mock calls
raw docstring

MockFnComponentclj

For mocking components whose instances are a function. Records all calls to the function as a tuple of

[[:component-group-name :component-name] [arg-1 arg-2 ...]]

Set value the mock function should return under [::ds/config :return].

  • If this is a function, then the function will be called
  • If you need to return a literal function, use (constantly (fn []))
  • Use something like (cycle [1 2 3]) to return different values on consecutive c alls
For mocking components whose instances are a function. Records all calls to the
function as a tuple of

[[:component-group-name :component-name] [arg-1 arg-2 ...]]

Set value the mock function should return under [::ds/config :return].
- If this is a function, then the function will be called
- If you need to return a literal function, use (constantly (fn []))
- Use something like (cycle [1 2 3]) to return different values on consecutive c
  alls
raw docstring

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

× close