Fork me on GitHub
#kaocha
<
2020-03-19
>
plexus15:03:56

@oliy exceptions are handled by the is macro, so they will always bubble up to there.

oliy15:03:25

hi @plexus thanks, so do i need to hook into what is does more directly, rather than relying on the reporter?

plexus15:03:36

I don't see how you would do that. is just sets up a try/catch, so when you're in the catch branch you're no longer in the try

plexus15:03:11

(defmacro try-expr
  "Used by the 'is' macro to catch unexpected exceptions.
  You don't call this."
  {:added "1.1"}
  [msg form]
  `(try ~(assert-expr msg form)
        (catch Throwable t#
          (do-report {:type :error, :message ~msg,
                      :expected '~form, :actual t#}))))

oliy18:03:17

Interesting. I have a fixture around the test that is setting up the browser connection, so I'd expect the bindings to still be available when do-report is called. When I inspected the stack trace from inside my :error reporter it didn't contain any of my fixtures

oliy18:03:24

I'll have another look