diff --git a/src/test/om/next/tests.cljc b/src/test/om/next/tests.cljc index b646106e..ad3351a7 100644 --- a/src/test/om/next/tests.cljc +++ b/src/test/om/next/tests.cljc @@ -1057,25 +1057,26 @@ (is (not (contains? (get t-err 'this/throws) :result))) (is (= (get (om/transact! r '[(this/throws) :app/count]) :app/count) 2)))) -(deftest test-cache-clear - (let [r (om/reconciler {:state (atom {:app/count 0}) - :parser p}) - h (get-in r [:config :history])] - (is (= 0 (count @(.-index h)))) - (is (= 0 (count (.-arr h)))) - (om/transact! r '[(app/inc!)]) - (let [h (get-in r [:config :history])] - (is (= 1 (count @(.-index h)))) - (is (= 1 (count (.-arr h))))) - (let [r' (update-in r [:config :history] #(.clear %)) - h' (get-in r' [:config :history])] - (is (= {} @(.-index h'))) - (is (= 0 (count (.-arr h')))) - (is (= [] (js->clj (.-arr h'))))) - (om/transact! r '[(app/inc!)]) - (let [h (get-in r [:config :history])] - (is (= 1 (count @(.-index h)))) - (is (= 1 (count (.-arr h))))))) +#?(:cljs + (deftest test-cache-clear + (let [r (om/reconciler {:state (atom {:app/count 0}) + :parser p}) + h (get-in r [:config :history])] + (is (= 0 (count @(.-index h)))) + (is (= 0 (count (.-arr h)))) + (om/transact! r '[(app/inc!)]) + (let [h (get-in r [:config :history])] + (is (= 1 (count @(.-index h)))) + (is (= 1 (count (.-arr h))))) + (let [r' (update-in r [:config :history] #(.clear %)) + h' (get-in r' [:config :history])] + (is (= {} @(.-index h'))) + (is (= 0 (count (.-arr h')))) + (is (= [] (js->clj (.-arr h'))))) + (om/transact! r '[(app/inc!)]) + (let [h (get-in r [:config :history])] + (is (= 1 (count @(.-index h)))) + (is (= 1 (count (.-arr h)))))))) ;; ----------------------------------------------------------------------------- ;; Recursive Parsing