Skip to content

Commit

Permalink
Make !state atom defonce
Browse files Browse the repository at this point in the history
  • Loading branch information
PEZ committed Jan 22, 2024
1 parent 5f6001c commit ab2fc88
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .joyride/src/seatbelt/runner.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
:fail 0
:error 0})

(def ^:private !state (atom default-db))
(defonce ^:private !state (atom default-db))

(defn ^:private init-counters! []
(swap! !state merge (select-keys default-db [:pass :fail :error])))
Expand Down Expand Up @@ -90,7 +90,7 @@
(if (:ready-to-run? @!state)
(run-tests-impl!+ test-nss)
(do
(println "seatbelt: " waiting-message)
(println "seatbelt:" waiting-message)
(add-watch !state :runner (fn [k r _o n]
(when (:ready-to-run? n)
(remove-watch r k)
Expand Down Expand Up @@ -127,7 +127,6 @@
(let [relative-path (vscode/workspace.asRelativePath uri)]
(println reason relative-path)
(println "Running tests...")
(println "BOOM! relative-path:" relative-path)
(when-not (or (= "." uri)
; We do not handle reloading of the runner itself yet
(.endsWith relative-path "seatbelt/runner.cljs"))
Expand Down

0 comments on commit ab2fc88

Please sign in to comment.