Fork me on GitHub
#leiningen
<
2017-07-06
>
danielcompton00:07:06

I don't remember the syntax, but it'll be something like lein test my-co.my-app.*

matan16:07:46

@danielcompton you are right! oh right, how did I forget about that! 🤓

matan16:07:37

One more ― I have it that when I print to the console (`println` pprint or puget.printer), the printing doesn't happen if an exception is thrown in my code near and after the point of the printing.

matan16:07:37

Just wondering, is this happening to other folks as well, is there a way to change that behavior? it seems to recur in all of my projects

danielcompton21:07:09

@matan when you print, it won't flush to the console immediately. http://yellerapp.com/posts/2014-12-11-14-race-condition-in-clojure-println.html is a good guide to what's going on

danielcompton21:07:19

You can replace it with a few different options. One option not mentioned there which I just thought of could be to use:

(use-fixtures :once (fn [f]
                      (binding [*flush-on-newline* true]
                        (f))))
Using a proper logging library is a better long-term route, but println is still handy for unit tests

danielcompton21:07:36

Not sure if that code snippet works, but it seems like it should

matan23:07:35

@danielcompton ah, thank you, I was beginning to think I am merely hallucinating 😌