Test cursor assertion only if assertions are enabled

This commit is contained in:
Juho Teperi 2020-01-15 10:57:36 +02:00
parent afd4d89808
commit 40e1ca306b
1 changed files with 6 additions and 1 deletions

View File

@ -469,5 +469,10 @@
(is (= @spy false)) (is (= @spy false))
(dispose r))) (dispose r)))
(def assert-enabled? (try (assert false)
false
(catch :default _ true)))
(deftest cursor-assert-test (deftest cursor-assert-test
(is (thrown-with-msg? :default #"src must be a reactive atom or a function, not nil while attempting to get path: \[:foo :bar\]" (r/cursor nil [:foo :bar])))) (when assert-enabled?
(is (thrown-with-msg? :default #"src must be a reactive atom or a function, not nil while attempting to get path: \[:foo :bar\]" (r/cursor nil [:foo :bar])))))