Re: cljs.test :after fixture not called if test errors

2020-11-27 Thread Stuart Campbell
Makes sense. Thanks all! On Wed, Nov 25, 2020, 6:46 PM David Nolen wrote: > In the async case just handle the error yourself and fail the test. > There's really not a good way to detect async errors since there isn't one > way to. do async (promises, core.async, etc.). > > David > > On Wed, Nov

Re: cljs.test :after fixture not called if test errors

2020-11-25 Thread David Nolen
In the async case just handle the error yourself and fail the test. There's really not a good way to detect async errors since there isn't one way to. do async (promises, core.async, etc.). David On Wed, Nov 25, 2020 at 1:19 AM Stuart Campbell wrote: > That unfortunately doesn't work for async

Re: cljs.test :after fixture not called if test errors

2020-11-24 Thread Stuart Campbell
That unfortunately doesn't work for async tests, which require the map fixture style (with :before/:after keys). On Tue, 24 Nov 2020 at 21:23, Estevo U. C. Castro wrote: > Try > > (use-fixtures :once > (fn [f] > (println "before") > (try (f) > (finally (println "after") > > O

Re: cljs.test :after fixture not called if test errors

2020-11-24 Thread Estevo U. C. Castro
Try (use-fixtures :once (fn [f] (println "before") (try (f) (finally (println "after") O mércores, 25 de novembro de 2020 á/s 00:17:03 UTC+1, stuart.will...@gmail.com escribiu: > Hello, > > I'm experimenting with fixtures and it seems like :after fixtures aren't > run if

cljs.test :after fixture not called if test errors

2020-11-24 Thread Stuart Campbell
Hello, I'm experimenting with fixtures and it seems like :after fixtures aren't run if a test unexpectedly errors. E.g.: (use-fixtures :once {:before #(println "before") :after #(println "after")}) (deftest a-test (raise (js/Error. "oops"))) In this example I expected to