Liking cljdoc? Tell your friends :D

fulcro-spec.check


all*clj/s

(all* c & cs)

Takes one or more checkers, and returns a new checker. That checker takes an actual argument, and calls every checker with it as the first and only argument. Returns nil or a sequence of maps matching check-failure?.

Takes one or more `checker`s, and returns a new `checker`.
That checker takes an `actual` argument, and calls every checker with it as the first and only argument.
Returns nil or a sequence of maps matching `check-failure?`.
sourceraw docstring

append-messageclj/s

(append-message message failures)

WARNING: INTERNAL HELPER, DO NOT USE!

WARNING: INTERNAL HELPER, DO NOT USE!
sourceraw docstring

check-exprclj/s

(check-expr msg [_ checker actual])
source

check-failure?clj/s

(check-failure? x)
source

checkerclj/smacro

(checker arglist & args)

Creates a function that takes only one argument (usually named actual). For use in =check=> assertions. NOTE: the fact that a checker is just a fn with metadata is an internal detail, do not rely on that fact, and prefer usage of this checker macro.

Creates a function that takes only one argument (usually named `actual`).
For use in =check=> assertions.
NOTE: the fact that a checker is just a fn with metadata is an internal detail, do not rely on that fact, and prefer usage of this `checker` macro.
sourceraw docstring

checker?clj/s

(checker? x)

Checks if passed in argument was a function created by the checker macro. NOTE: the fact that a checker is just a fn with metadata is an internal detail, do not rely on that fact, and prefer usage of the checker macro.

Checks if passed in argument was a function created by the `checker` macro.
NOTE: the fact that a checker is just a fn with metadata is an internal detail, do not rely on that fact, and prefer usage of the `checker` macro.
sourceraw docstring

embeds?*clj/s

(embeds?* expected)

Takes a map and returns a checker that checks if the values at the keys match (using =) . The map values can be checkers, but will throw an error if passed a raw function. The map can be arbitrarily nested with further maps, eg:

(embeds?* {:a 1, :b {:c (is?* even?)}}) =check=> {:a 1, :b {:c 2}}
Takes a map and returns a checker that checks if the values at the keys match (using `=`) .
The map values can be `checker`s, but will throw an error if passed a raw function.
The map can be arbitrarily nested with further maps, eg:
```
(embeds?* {:a 1, :b {:c (is?* even?)}}) =check=> {:a 1, :b {:c 2}}
```
sourceraw docstring

equals?*clj/s

(equals?* expected)

Takes any value and returns a checker that checks for equality.

Takes any value and returns a checker that checks for equality.
sourceraw docstring

every?*clj/s

(every?* c & cs)

Takes one or more checkers, and returns a checker that runs all checker arguments on each element of the checker argument sequence.

Takes one or more checkers, and returns a checker that runs all checker arguments on each element of the checker argument sequence.
sourceraw docstring

exists?*clj/s

(exists?* msg)

Takes a failure message and returns a checker that checks for non-nil values.

Takes a failure message and returns a checker that checks for non-nil values.
sourceraw docstring

in*clj/s

(in* path c & cs)

Takes a path and one or more checkers, and returns a checker that focuses the checker argument on the result of running (get-in actual path). If the call to get-in failed it returns a check-failure?.

Takes a path and one or more checkers, and returns a checker that focuses the checker argument on the result of running `(get-in actual path)`.
If the call to `get-in` failed it returns a `check-failure?`.
sourceraw docstring

is?*clj/s

(is?* predicate)

Takes any truthy predicate function and returns a checker that checks with said predicate.

Takes any truthy predicate function and returns a checker that checks with said predicate.
sourceraw docstring

prepend-messageclj/s

(prepend-message msg fail)

WARNING: INTERNAL HELPER, DO NOT USE!

WARNING: INTERNAL HELPER, DO NOT USE!
sourceraw docstring

re-find?*clj/s

(re-find?* regex)

Takes a regex (or string) and returns a checker that checks using re-find.

Takes a regex (or string) and returns a checker that checks using `re-find`.
sourceraw docstring

seq-matches?*clj/s

(seq-matches?* coll)

Takes a sequential? collection, and returns a checker that checks its argument in a sequential manner, ie: (seq-matches?* [1 2]) =check=> [1 2] Can also take checkers as values, eg: (seq-matches?* [(is?* pos?)]) =check=> [42]

Takes a `sequential?` collection, and returns a checker that checks its argument in a sequential manner, ie:
`(seq-matches?* [1 2]) =check=> [1 2]`
Can also take checkers as values, eg:
`(seq-matches?* [(is?* pos?)]) =check=> [42]`
sourceraw docstring

valid?*clj/s

(valid?* spec)

Takes any valid clojure.spec.alpha/spec and returns a checker. The checker checks with s/valid? and calls s/explain-str for the :message.

Takes any valid clojure.spec.alpha/spec and returns a checker.
The checker checks with `s/valid?` and calls `s/explain-str` for the `:message`.
sourceraw docstring

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

× close