kaocha

Official support channel: https://clojureverse.org/c/projects/kaocha
plexus 2019-08-08T06:23:17.067Z

Not as such, but should be quite doable with a plugin

πŸ‘ 1
avi 2019-08-08T07:50:59.068500Z

Cool, thanks!

2019-08-08T07:47:48.067800Z

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? πŸ™‚

2019-08-08T07:48:07.068100Z

(the test report is still displayed in my repl)

plexus 2019-08-08T07:56:45.069400Z

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?

2019-08-08T07:58:26.069600Z

I'll give that a shot!

2019-08-08T08:01:07.069800Z

Running:

(with-out-str
    (kaocha.repl/run {:capture-output? false}))

2019-08-08T08:01:11.070Z

I still get ""

2019-08-08T08:01:18.070300Z

but now my repl looks like this:

2019-08-08T08:01:37.070400Z

2019-08-08T08:01:41.070800Z

πŸ˜›

2019-08-08T08:02:12.071400Z

To give some context: I'm trying to make a kaocha plugin for Emacs, showing output in a separate buffer πŸ™‚

2019-08-08T10:44:21.071900Z

If you have any ideas at all, @plexus I'd be happy to try them out.

plexus 2019-08-08T10:52:01.072700Z

(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 purpose

2019-08-08T10:52:26.073100Z

Aha! Brilliant β€οΈπŸ˜„ I'll check it out at once.

2019-08-08T10:54:07.073900Z

Excellent, that did the trick. Now I have some fun emacs lisp coding to do in preparation for the next live stream. πŸ™‚

2019-08-08T10:54:17.074100Z

Thanks for the help!

plexus 2019-08-08T11:03:04.074600Z

Looking forward! This has been requested more than one :)

vikeri 2019-08-08T11:13:51.075600Z

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!

plexus 2019-08-08T11:39:41.076100Z

That's awesome @vikeri! Really nice to hear!

πŸ‘ 1