From c1388a687bd50cfa01238f9901a051fa57760af6 Mon Sep 17 00:00:00 2001 From: Juho Teperi Date: Tue, 13 Mar 2018 21:34:57 +0200 Subject: [PATCH] Improve error-boundary test --- test/reagenttest/testreagent.cljs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/reagenttest/testreagent.cljs b/test/reagenttest/testreagent.cljs index 9968f8f..70d41be 100644 --- a/test/reagenttest/testreagent.cljs +++ b/test/reagenttest/testreagent.cljs @@ -1004,16 +1004,15 @@ [:div "Something went wrong."] comp))})) comp1 (fn comp1 [] - ($ nil :foo) - [:div "foo"])] + (throw (js/Error. "Test error")))] (debug/track-warnings (wrap-capture-window-error (wrap-capture-console-error #(with-mounted-component [error-boundary [comp1]] (fn [c div] (r/flush) - (is (= "Cannot read property 'foo' of null" (.-message @error))) - (is (found-in #"Something went wrong\." div)))))))))) + (is (= "Test error" (.-message @error))) + (is (re-find #"Something went wrong\." (.-innerHTML div))))))))))) (deftest test-dom-node (let [node (atom nil)