kaocha icon indicating copy to clipboard operation
kaocha copied to clipboard

Support for expectations

Open plexus opened this issue 5 years ago • 2 comments

Expectations is a minimalist testing framework built around the expect macro. (source)

(expect 1 1)
(expect #"foo" "boofooar")
(expect ArithmeticException (/ 12 0))
(expect :foo (in #{:foo :bar}))

Note that expectations has two "modes", a newer one based on clojure.test (defexpect ~= deftest), and the original one, which is completely seperate from clojure.test. The former one should work just fine with Kaocha's :kaocha.type/clojure.test, the latter is what this ticket is about.

Since expect just defines a var with metadata ^{:expectation true}, implementing the load step should be straightforward and largely mimic the clojure.test ns/var approach. To implement the run step we'll have to figure out how to capture pass/fail/error events from expectations and convert them into clojure.test/do-report style events.

plexus avatar Jan 15 '19 08:01 plexus

I spoke with Arne about this, and given that it's been two years, we're probably not going to support classic expectations.

alysbrooks avatar Mar 09 '21 02:03 alysbrooks

Yes, to elaborate a bit more, clojure.test based expectations should work out of the box. If it doesn't or behaves weirdly then please file an issue and we can look into it. Classic expectations should be easy enough to support, as mentioned above, but no one has ever asked for it, and presumably people are generally moving away from it, so we are not going to allocate resources to it.

We would be happy to accept a community contribution for this though, and are available to help anyone willing to work on that.

plexus avatar Mar 09 '21 04:03 plexus

Closing as "wontfix" as explained above.

plexus avatar Jan 25 '23 09:01 plexus