Liking cljdoc? Tell your friends :D
ClojureScript only.

otarta.test-helpers


sub?cljs

(sub? sub x)

true if sub is either nil, equal to x, or a recursive subcollection of x. If sub is a sequential collection of size N the first N elements of x are tested. If sub is a map every value in sub is tested with the corresponding value in x. If sub is a set every key in sub should exist in x. Examples: (sub? nil {:anything :at-all}) (sub? [:a :b] [:a :b :c]) (not (sub? [:a :b :c] [:a :b])) (sub? {:a [1 2 3]} {:a [1 2 3 4] :b 2}) (sub? {:a [1 nil 3]} {:a [1 2 3 4] :b 2}) (not (sub? {:a [1 2 3 4]} {:a [1 2 3] :b 2})) (sub? #{:a} {:a 1 :b 2}) (sub? #{:a} #{:a :b}) (not (sub? #{:a :c} #{:a :b})) (sub? :something :something) (sub? [:1 :2 :3] (list :1 :2 :3)) (sub? [:1 :2] (list :1 :2 :3)) (sub? (list :1 :2 :3) [:1 :2 :3]) (not (sub? (list nil 2) [:1 :2 :3]))

true if `sub` is either `nil`, equal to `x`, or a recursive
subcollection of `x`.
If sub is a sequential collection of size N the first N elements of
`x` are tested. If sub is a map every value in sub is tested with
the corresponding value in `x`. If `sub` is a set every *key* in sub
should exist in `x`.
**Examples:**
    (sub? nil
          {:anything :at-all})
    (sub? [:a :b]
          [:a :b :c])
    (not (sub? [:a :b :c]
               [:a :b]))
    (sub? {:a [1 2 3]}
          {:a [1 2 3 4] :b 2})
    (sub? {:a [1 nil 3]}
          {:a [1 2 3 4] :b 2})
    (not (sub? {:a [1 2 3 4]}
               {:a [1 2 3] :b 2}))
    (sub? #{:a}
          {:a 1 :b 2})
    (sub? #{:a}
          #{:a :b})
    (not (sub? #{:a :c}
               #{:a :b}))
    (sub? :something
          :something)
    (sub? [:1 :2 :3]
          (list :1 :2 :3))
    (sub? [:1 :2]
          (list :1 :2 :3))
    (sub? (list :1 :2 :3)
          [:1 :2 :3])
    (not (sub? (list nil 2)
               [:1 :2 :3]))
raw docstring

test-asynccljs

(test-async ch)

Asynchronous test awaiting ch to produce a value or close.

Asynchronous test awaiting ch to produce a value or close.
raw docstring

test-withincljs

(test-within ms ch)

Asserts that ch does not close or produce a value within ms. Returns a channel from which the value can be taken.

Asserts that ch does not close or produce a value within ms. Returns a
channel from which the value can be taken.
raw docstring

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

× close