mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
💄 Add indentation fixes on frontend tests
This commit is contained in:
@@ -19,21 +19,28 @@
|
|||||||
|
|
||||||
;; ---- Helpers to manage global events
|
;; ---- Helpers to manage global events
|
||||||
|
|
||||||
|
(defn on-error
|
||||||
|
[cause]
|
||||||
|
(js/console.log "[CAUSE]:" (.-stack cause))
|
||||||
|
(js/console.log "[DATA]:" (pr-str (ex-data cause))))
|
||||||
|
|
||||||
(defn prepare-store
|
(defn prepare-store
|
||||||
"Create a store with the given initial state. Wait until
|
"Create a store with the given initial state. Wait until
|
||||||
a :the/end event occurs, and then call the function with
|
a :the/end event occurs, and then call the function with
|
||||||
the final state at this point."
|
the final state at this point."
|
||||||
[state done completed-cb]
|
[state done completed-cb]
|
||||||
(let [store (ptk/store {:state state})
|
(let [store (ptk/store {:state state :on-error on-error})
|
||||||
stream (ptk/input-stream store)
|
stream (ptk/input-stream store)
|
||||||
stream (->> stream
|
stream (->> stream
|
||||||
(rx/take-until (rx/filter #(= :the/end %) stream))
|
(rx/take-until (rx/filter #(= :the/end %) stream))
|
||||||
(rx/last)
|
(rx/last)
|
||||||
(rx/do
|
(rx/do (fn []
|
||||||
(fn []
|
(completed-cb @store)))
|
||||||
(completed-cb @store)))
|
(rx/subs (fn [_] (done))
|
||||||
(rx/subs done #(throw %)))]
|
(fn [cause]
|
||||||
|
(js/console.log "[error]:" cause))
|
||||||
|
(fn [_]
|
||||||
|
(js/console.log "[complete]"))))]
|
||||||
store))
|
store))
|
||||||
|
|
||||||
;; Remove definitely when we ensure that the above method works
|
;; Remove definitely when we ensure that the above method works
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user