     [re-frame.core :as re-frame]
     [re-frame.fx]
     [re-frame.interop :refer [set-timeout!]]
-    [re-frame.loggers :as log]))
+    [re-frame.loggers :as log]
+    [clojure.string :as str]))
 
 ;; ---- FIXTURES ---------------------------------------------------------------
 

    {:before #(reset! restore-re-frame (re-frame.core/make-restore-fn))
     :after  #(@restore-re-frame)}))

(defn fixture-logger
  []
  (let [old-loggers (atom nil)]
    {:before #(reset! old-loggers @@#'log/loggers)
     :after  #(reset! @#'log/loggers @old-loggers)}))

(use-fixtures :each (fixture-re-frame) (fixture-logger))

;; ---- TESTS ------------------------------------------------------------------


      ;; kick off main handler
      (re-frame/dispatch [::later-test]))))

(re-frame/reg-event-fx
  ::missing-handler-test
  (fn [_world _event-v]
    {:fx-not-exist [:nothing :here]}))

(deftest report-missing-handler
  (let [logs             (atom [])
        log-fn           (fn [& args] (swap! logs conj (str/join args)))
        original-loggers (log/get-loggers)]
    (try
      (log/set-loggers! {:error log-fn})
      (re-frame/dispatch-sync [::missing-handler-test])
      (is (re-matches #"re-frame: no :fx handler registered for::fx-not-exist" (first @logs)))
      (is (= (count @logs) 1))
      (finally
        (log/set-loggers! original-loggers)))))
