Liking cljdoc? Tell your friends :D

reacl-c.test-util.core


*max-update-loops*cljs

source

combine-emulatorscljs

(combine-emulators emu1 & more)

Combine two or more effect emualtors into one.

Combine two or more effect emualtors into one.
sourceraw docstring

effect-argscljs

(effect-args eff)
source

effect-fcljs

(effect-f eff)
source

effect?cljs

(effect? a & [eff-defn])
source

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.

Executed the given effect in the given test environment.
sourceraw docstring

get-componentcljs

source

inject-action!cljs

(inject-action! comp action)
source

inject-return!cljs

(inject-return! comp ret)
source

inject-state-change!cljs

(inject-state-change! comp state)
source

invoke-callback!cljs

(invoke-callback! comp callback event)
source

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)
source

performance-checkcljs

(performance-check item state-seq)

For all the given states, this checks that for the same state, the item renders to the equal item; i.e. rendering has no side effects. If that it true, it also checks that for different states, it renders to different items; i.e. the state is minimal for this item. Note that this test makes most sense for 'dynamic' items. Returns :bad, :good, :ideal depending on these results.

For all the given states, this checks that for the same state, the
item renders to the equal item; i.e. rendering has no side
effects. If that it true, it also checks that for different states,
it renders to different items; i.e. the state is minimal for this
item. Note that this test makes most sense for 'dynamic'
items. Returns :bad, :good, :ideal depending on these results.
sourceraw docstring

providedcljmacro

(provided bindings & body)
source

push!cljs

(push! env ret)
source

push!!cljs

(push!! env ret)
source

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

seq-diffcljs

(seq-diff s1 s2)
source

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)
source

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

verify-performancecljs

(verify-performance level item state-seq)
source

verify-performance!cljs

(verify-performance! level item state-seq)
source

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

× close