I am learning Clojure, and trying to use TDD to do so *.
I use midje as a testing library. Love it so far, the expected versus actual results display is very helpfull.
But is there was a way to use clojure.tools.trace
or something similar to print the trace of the first test that fails ?
*: Specifically, I remember seeing a talk by Robert C. Martin about the transformation priority premise, and I'm implementing a factorial function this way. There isn't yet much code to show though.
One possibility would be writing your own emitter but that might be overkill for your specific goal.
Alternatively, you can monkey-patch the function responsible for formatting the expected values:
format-captured-throwable
has to produce a string, though, meaning that directly printing the stacktrace will let it end up nowhere near midje's test report.