kaocha

2022-12-08T17:14:23.378649Z

I've found a bug, but I don't have a good reproduction cuz it's all wrapped up in my company's private code. I'll try to describe it and maybe we can refine it through discussion before I write up a github issue

2022-12-08T17:20:27.175709Z

In clojure.test, the function test-vars calls each-fixture-fn, wrapping calling test-var on each test function being run. test-var wraps the test function in a try-catch, and if there's an error in the test, it logs an error directly.

2022-12-08T17:22:32.581819Z

This is to say that the once and each fixtures don't see any exceptions thrown by the test because the fixture wraps a new anonymous function that calls test-var on the test function

2022-12-08T17:25:19.416059Z

kaocha wraps the test functions directly in kaocha.type.var with the reduce call. Then the wrapped test is executed within the try-catch block, so the fixtures see the exception.

2022-12-08T17:26:54.789729Z

if the fixture catches and doesn't rethrow the exception, then no error is reported and the test is treated as successful

2022-12-08T19:47:29.331819Z

I hope I did this right: https://github.com/lambdaisland/kaocha/issues/367

plexus 2022-12-08T20:15:31.826839Z

Interesting! Thanks for reporting!

2022-12-08T21:19:18.341769Z

And the fix: https://github.com/lambdaisland/kaocha/pull/368

1
🎉 2