Makes sense. Thanks all!

On Wed, Nov 25, 2020, 6:46 PM David Nolen <dnolen.li...@gmail.com> 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 25, 2020 at 1:19 AM Stuart Campbell <stu...@harto.org> wrote:
>
>> 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 <euccas...@gmail.com>
>> wrote:
>>
>>> 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 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 see "after" printed somewhere after the
>>>> test failed. Is this intentional?
>>>>
>>>> (I'm writing some tests for an Electron app using Spectron and want to
>>>> make sure the app is always shut down after the tests are complete.)
>>>>
>>>> Regards,
>>>> Stuart
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clojure@googlegroups.com
>>> Note that posts from new members are moderated - please be patient with
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clojure+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> ---
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Clojure" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/clojure/N28pFLtNWpo/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> clojure+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/clojure/84dff1cf-6ea0-438c-a4c0-fac097223201n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/clojure/84dff1cf-6ea0-438c-a4c0-fac097223201n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/clojure/CAFuJp1n1Vz8NKf%3DmxakTYn1EXF8UUqTQwc5NiDUKGMOj-BKBsQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/clojure/CAFuJp1n1Vz8NKf%3DmxakTYn1EXF8UUqTQwc5NiDUKGMOj-BKBsQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/N28pFLtNWpo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> clojure+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/clojure/CAPC9OaetpVoUTexro%3DcJwPghEM8vLeHeHvW8G-3dok_8EfSpug%40mail.gmail.com
> <https://groups.google.com/d/msgid/clojure/CAPC9OaetpVoUTexro%3DcJwPghEM8vLeHeHvW8G-3dok_8EfSpug%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CAFuJp1nACP2qMzMScApoX3i7aNnPLD%3DPPkORHo31vwZATpCsHw%40mail.gmail.com.

Reply via email to