Not as such, but should be quite doable with a plugin
Cool, thanks!
The docs for kaocha.repl/run says that output is sent to stdout, but I'm not able to capture it.
(require 'kaocha.repl)
(with-out-str
(kaocha.repl/run)) ;; => ""
Any ideas? π(the test report is still displayed in my repl)
not off the top of my head @magnars, I'm guessing *out*
is being rebound more than once, maybe in the output capturing plugin. Does it work if you disable output capturing?
I'll give that a shot!
Running:
(with-out-str
(kaocha.repl/run {:capture-output? false}))
I still get ""
but now my repl looks like this:
π
To give some context: I'm trying to make a kaocha plugin for Emacs, showing output in a separate buffer π
If you have any ideas at all, @plexus I'd be happy to try them out.
(defmacro with-test-out-str
[& body]
`(let [s# (new java.io.StringWriter)]
(binding [clojure.test/*test-out* s#]
~@body
(str s#))))
(with-test-out-str
(kaocha.repl/run))
@magnars this seems to do the trick, clojure test has its own *test-out*
var for this purposeAha! Brilliant β€οΈπ I'll check it out at once.
Excellent, that did the trick. Now I have some fun emacs lisp coding to do in preparation for the next live stream. π
Thanks for the help!
Looking forward! This has been requested more than one :)
Just want to say that I migrated all our backend tests to kaocha and itβs very nice! Great work @plexus and others who contributed!
That's awesome @vikeri! Really nice to hear!