                                             (done)))))
 
   (testing "broadcast! an non-existing event fails"
-    (let [err-handler (fn [err]
-                        (is (re-find #"No method .* for dispatch value: :non-existing-broadcast" (.toString err))))]
-      (obj/set js/window "onerror" err-handler)
-      (citrus/broadcast! r :non-existing-broadcast)
-      (async done (js/requestAnimationFrame (fn []
-                                              (obj/set js/window "onerror" nil)
-                                              (done)))))))
+    (is (thrown-with-msg? js/Error
+                          #"Assert failed: Controller :test doesn't declare :non-existing-broadcast method"
+                          (citrus/broadcast! r :non-existing-broadcast)))))
 
 (deftest dispatch-nil-state-issue-20
   ;https://github.com/roman01la/citrus/issues/20


  (testing "broadcast-sync! a non-existing event fails"
    (is (thrown-with-msg? js/Error
                          #"No method .* for dispatch value: :non-existing-event"
                          (citrus/broadcast-sync! r :non-existing-event)))))




  (testing "dispatch-sync! a non-existing event fails"
    (is (thrown-with-msg? js/Error
                          #"Assert failed: Controller :test doesn't declare :non-existing-event method"
                          (citrus/dispatch-sync! r :test :non-existing-event)))))


