mirror of https://github.com/status-im/reagent.git
Omit tests running in node
This commit is contained in:
parent
e4fee70ac2
commit
55a4b4e1df
|
@ -567,38 +567,40 @@
|
|||
(is (= (rstr [c2]) "<div>foo</div>"))))
|
||||
|
||||
(deftest basic-with-let
|
||||
(let [n1 (atom 0)
|
||||
n2 (atom 0)
|
||||
n3 (atom 0)
|
||||
val (r/atom 0)
|
||||
c (fn []
|
||||
(r/with-let [v (swap! n1 inc)]
|
||||
(swap! n2 inc)
|
||||
[:div @val]
|
||||
(finally
|
||||
(swap! n3 inc))))]
|
||||
(with-mounted-component [c]
|
||||
(fn [_ div]
|
||||
(is (= [1 1 0] [@n1 @n2 @n3]))
|
||||
(swap! val inc)
|
||||
(is (= [1 1 0] [@n1 @n2 @n3]))
|
||||
(r/flush)
|
||||
(is (= [1 2 0] [@n1 @n2 @n3]))))
|
||||
(is (= [1 2 1] [@n1 @n2 @n3]))))
|
||||
(when isClient
|
||||
(let [n1 (atom 0)
|
||||
n2 (atom 0)
|
||||
n3 (atom 0)
|
||||
val (r/atom 0)
|
||||
c (fn []
|
||||
(r/with-let [v (swap! n1 inc)]
|
||||
(swap! n2 inc)
|
||||
[:div @val]
|
||||
(finally
|
||||
(swap! n3 inc))))]
|
||||
(with-mounted-component [c]
|
||||
(fn [_ div]
|
||||
(is (= [1 1 0] [@n1 @n2 @n3]))
|
||||
(swap! val inc)
|
||||
(is (= [1 1 0] [@n1 @n2 @n3]))
|
||||
(r/flush)
|
||||
(is (= [1 2 0] [@n1 @n2 @n3]))))
|
||||
(is (= [1 2 1] [@n1 @n2 @n3])))))
|
||||
|
||||
(deftest with-let-destroy-only
|
||||
(let [n1 (atom 0)
|
||||
n2 (atom 0)
|
||||
c (fn []
|
||||
(r/with-let []
|
||||
(swap! n1 inc)
|
||||
[:div]
|
||||
(finally
|
||||
(swap! n2 inc))))]
|
||||
(with-mounted-component [c]
|
||||
(fn [_ div]
|
||||
(is (= [1 0] [@n1 @n2]))))
|
||||
(is (= [1 1] [@n1 @n2]))))
|
||||
(when isClient
|
||||
(let [n1 (atom 0)
|
||||
n2 (atom 0)
|
||||
c (fn []
|
||||
(r/with-let []
|
||||
(swap! n1 inc)
|
||||
[:div]
|
||||
(finally
|
||||
(swap! n2 inc))))]
|
||||
(with-mounted-component [c]
|
||||
(fn [_ div]
|
||||
(is (= [1 0] [@n1 @n2]))))
|
||||
(is (= [1 1] [@n1 @n2])))))
|
||||
|
||||
(deftest with-let-non-reactive
|
||||
(let [n1 (atom 0)
|
||||
|
|
Loading…
Reference in New Issue