Liking cljdoc? Tell your friends :D

montoux.test.mock

Clojurescript functions for mocking, based on examples from 'Clojure in action'. Functions to be mocked must be declared dynamic.

Clojurescript functions for mocking, based on examples from 'Clojure in action'.
Functions to be mocked must be declared dynamic.
raw docstring

callscljs

(calls f)

failcljs

(fail)
(fail message)

last-callcljs

(last-call f)

Return the arguments to the most recent call to f, or nil if there was no call. f must be a mock.

Return the arguments to the most recent call to `f`, or nil if there was no call. `f` must be a mock.
raw docstring

mockcljs

(mock f)

Constuct a mock that will capture arguments and return the result of applying f to the arguments.

Constuct a mock that will capture arguments and return the result of applying `f` to the arguments.
raw docstring

not-calledcljs

(not-called f)

Return true iff f was not called. f must be a mock.

Return true iff `f` was not called. `f` must be a mock.
raw docstring

only-callcljs

(only-call f)

Return the arguments to the only call to f, or nil if there was not exactly one call to f. f must be a mock.

Return the arguments to the only call to `f`, or nil if there was not exactly one call to `f`. `f` must be a mock.
raw docstring

stubcljs

(stub v)

Construct a mock that will capture arguments while always returning v.

Construct a mock that will capture arguments while always returning `v`.
raw docstring

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

× close