Liking cljdoc? Tell your friends :D

reacl-c.test-util.core


combine-emulatorscljs

(combine-emulators emu1 & more)

Combine two or more effect emualtors into one, to be used with env.

Combine two or more effect emualtors into one, to be used with [[env]].
sourceraw docstring

describe-failed-findcljs

(describe-failed-find env item)
source

effect-argscljs

(effect-args eff)

Returns the arguments for the function returned by effect-f.

Returns the arguments for the function returned by [[effect-f]].
sourceraw docstring

effect-fcljs

(effect-f eff)

Returns the function implementing the effect behind the given effect action.

Returns the function implementing the effect behind the given effect action.
sourceraw docstring

effect?cljs

(effect? a & [eff-defn])

Returns true if the given action is an effect action, and optionally if it was created by the given effect function.

Returns true if the given action is an effect action, and
optionally if it was created by the given effect function.
sourceraw docstring

envcljs

(env item & [options])

Returns a new test environment to test the behavior of the given item. Options map may include

:emulator a function (fn [env effect] (return ...)) that may handle effect action reaching the toplevel.

Returns a new test environment to test the behavior of the given item.
Options map may include

:emulator   a function (fn [env effect] (return ...)) that may handle
            effect action reaching the toplevel.
sourceraw docstring

execute-effect!cljs

(execute-effect! env eff)

Executed the given effect in the given test environment, and return toplevel changes as a 'return' value.

Executed the given effect in the given test environment, and return
toplevel changes as a 'return' value.
sourceraw docstring

execute-effects-emulatorcljs

source

findcljs

(find env item)
source

find-allcljs

(find-all env item)
source

find-all-namedcljs

(find-all-named env thing)
source

find-namedcljs

(find-named env thing)
source

get-componentcljs

(get-component env)
source

inject-action!cljs

(inject-action! comp action)

Does the things that would happen if the given component emitted the given action, and returns what would be emitted (state and/or actions) from the tested item, in the form of a 'return' value.

Does the things that would happen if the given component emitted
the given action, and returns what would be emitted (state and/or
actions) from the tested item, in the form of a 'return' value.
sourceraw docstring

inject-action!!cljs

(inject-action!! comp action)

Like inject-action!, but also recursively update the item to new states that are returned.

Like [[inject-action!]], but also recursively update the item to new states that are returned.
sourceraw docstring

inject-return!cljs

(inject-return! comp ret)

Does the things that would happen if the given component returned the given 'return' value in reaction to some discrete event, and returns what would be emitted (state and/or actions) from the tested item, in the form of a 'return' value.

Does the things that would happen if the given component returned
the given 'return' value in reaction to some discrete event, and
returns what would be emitted (state and/or actions) from the tested
item, in the form of a 'return' value.
sourceraw docstring

inject-return!!cljs

(inject-return!! comp ret)

Like inject-return!, but also recursively update the item to new states that are returned.

Like [[inject-return!]], but also recursively update the item to new states that are returned.
sourceraw docstring

inject-state-change!cljs

(inject-state-change! comp state)

Does the things that would happen if the given component emitted the given new state, and returns what would be emitted (state and/or actions) from the tested item, in the form of a 'return' value.

Does the things that would happen if the given component emitted
the given new state, and returns what would be emitted (state and/or
actions) from the tested item, in the form of a 'return' value.
sourceraw docstring

inject-state-change!!cljs

(inject-state-change!! comp state)

Like inject-state-change!, but also recursively update the item to new states that are returned.

Like [[inject-state-change!]], but also recursively update the item to new states that are returned.
sourceraw docstring

invoke-callback!cljs

(invoke-callback! comp callback event)

Invokes the function assiciated with the given callback of the given test component of a dom element (e.g. :onclick), with the given event object, and returns a changed app-state and actions from the toplevel item, in the form of a reacl/return value.

Invokes the function assiciated with the given `callback` of the
given test component of a dom element (e.g. `:onclick`), with the
given event object, and returns a changed app-state and actions from
the toplevel item, in the form of a `reacl/return` value.
sourceraw docstring

invoke-callback!!cljs

(invoke-callback!! comp callback event)

Like invoke-callback!, but also recursively update the item to new states that are returned.

Like [[invoke-callback!]], but also recursively update the item to new states that are returned.
sourceraw docstring

mount!cljs

(mount! env state)

Mounts the item of the given test environment with the given state, and returns actions and maybe a changed state.

Mounts the item of the given test environment with the given
state, and returns actions and maybe a changed state.
sourceraw docstring

mount!!cljs

(mount!! env state)

Like mount!, but also recursively update the item to new states that are returned.

Like [[mount!]], but also recursively update the item to new states that are returned.
sourceraw docstring

preventing-error-logcljs

(preventing-error-log thunk)

Prevents a log message about an exception during the evaluation of thunk, which occurs event when the error is handled in an error boundary.

Prevents a log message about an exception during the evaluation of
`thunk`, which occurs event when the error is handled in an error
boundary.
sourceraw docstring

providedcljmacro

(provided bindings & body)
source

push!cljs

(push! env ret)

Apply the state change in the given 'return' value, if there is any, and merge the return value resulting from that - pushing the update cycle one turn.

Apply the state change in the given 'return' value, if there is
any, and merge the return value resulting from that - pushing the
update cycle one turn.
sourceraw docstring

push!!cljs

(push!! env ret)

Recursively apply the state change in the given 'return' value, until the state does not change anymore.

Recursively apply the state change in the given 'return' value,
until the state does not change anymore.
sourceraw docstring

send-message!cljs

(send-message! comp msg)

Sends a message to the given component or the toplevel component of the given test environment, and returns actions and maybe a changed state.

Sends a message to the given component or the toplevel component of
the given test environment, and returns actions and maybe a changed
state.
sourceraw docstring

send-message!!cljs

(send-message!! comp msg)

Like send-message!, but also recursively update the item to new states that are returned.

Like [[send-message!]], but also recursively update the item to new states that are returned.
sourceraw docstring

subscribe-effect-argscljs

(subscribe-effect-args eff)

The arguments passed to the subscription the given subscribe effect was generated from.

The arguments passed to the subscription the given subscribe effect was generated from.
sourceraw docstring

subscribe-effect?cljs

(subscribe-effect? eff)
(subscribe-effect? eff subs)

Tests if the given effect, is one that is emitted by a subscription equal to the given one on mount. This can be useful in unit tests.

Tests if the given effect, is one that is emitted by a subscription
equal to the given one on mount. This can be useful in unit tests.
sourceraw docstring

subscription-emulatorcljs

(subscription-emulator subs-env)

Returns the emulator function to be set as the :emulator option of a testing environemnt.

Returns the emulator function to be set as the :emulator option of
a testing environemnt.
sourceraw docstring

subscription-emulator-envcljs

(subscription-emulator-env sub)

Create a subscription emulation environment for items like the given subscription.

Create a subscription emulation environment for items like the
given subscription.
sourceraw docstring

subscription-emulator-inject!cljs

(subscription-emulator-inject! subs-env action)

Make the emulated subscription emit the given action.

Make the emulated subscription emit the given action.
sourceraw docstring

subscription-emulator-running?cljs

(subscription-emulator-running? subs-env)

Checks if the subscription emulation environment is attached as the :emulator to a testing environment and a subscription is mounted.

Checks if the subscription emulation environment is attached as
the :emulator to a testing environment and a subscription is
mounted.
sourceraw docstring

subscription-result!cljs

(subscription-result! env sub-eff action)

For the effect that resulted from mounting a subscription (see subscribe-effect?), inject the given action as a result of the subscription item, and return what the tested component in the given test environment returns.

For the effect that resulted from mounting a
subscription (see [[subscribe-effect?]]), inject the given action as
a result of the subscription item, and return what the tested
component in the given test environment returns.
sourceraw docstring

subscription-result-returncljs

(subscription-result-return env sub-eff action)
source

subscription-start!cljs

(subscription-start! env sub-eff & [stop-fn!])

Begins a simulated execution of the subscription given by the given effect that resulting from mounting it (see subscribe-effect?). The optional given stop-fn! will be called when the unsubscribe-effect? returned on unmount is executed.

Begins a simulated execution of the subscription given by the given
effect that resulting from mounting
it (see [[subscribe-effect?]]). The optional given `stop-fn!` will
be called when the [[unsubscribe-effect?]] returned on unmount is
executed.
sourceraw docstring

subscription-start-returncljs

(subscription-start-return env sub-eff & [stop-fn!])
source

unmount!cljs

(unmount! env)

Unmounts the item of the given test environment, and return actions and maybe a changed state.

Unmounts the item of the given test environment, and return
actions and maybe a changed state.
sourceraw docstring

unmount!!cljs

(unmount!! env)

Like unmount!, but also recursively update the item to new states that are returned.

Like [[unmount!]], but also recursively update the item to new states that are returned.
sourceraw docstring

unsubscribe-effect-argscljs

(unsubscribe-effect-args eff)

The arguments passed to the subscription the given unsubscribe effect was generated from.

The arguments passed to the subscription the given unsubscribe effect was generated from.
sourceraw docstring

unsubscribe-effect?cljs

(unsubscribe-effect? eff)
(unsubscribe-effect? eff subs)

Tests if the given effect, is one that is emitted by a subscription equal to the given one, on unmount. This can be useful in unit tests.

Tests if the given effect, is one that is emitted by a subscription
equal to the given one, on unmount. This can be useful in unit
tests.
sourceraw docstring

update!cljs

(update! env state)

Updates the state of the item of the given test environment, and returns actions and maybe a changed state.

Updates the state of the item of the given test environment, and
returns actions and maybe a changed state.
sourceraw docstring

update!!cljs

(update!! env state)

Updates the state of the item of the given test environment, and if the state is changed in reaction to that, then keeps on updating it. Returns actions and the final changed state, if it was changed at all. Throws if there are more than max-update-loops recursions, which are a sign for bug in the item.

Updates the state of the item of the given test environment, and
if the state is changed in reaction to that, then keeps on updating
it. Returns actions and the final changed state, if it was changed
at all. Throws if there are more than *max-update-loops* recursions,
which are a sign for bug in the item.
sourceraw docstring

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

× close