kaocha

Official support channel: https://clojureverse.org/c/projects/kaocha
vikeri 2019-11-19T10:30:49.032700Z

I’m struggling a little with adding directories to watch and compile in Clojure with kaocha and couldn’t find clarity on where to add this in the docs. Any example tests.edn that shows this?

plexus 2019-11-19T16:04:00.034200Z

:source-paths and :test-paths should be all you need @vikeri

plexus 2019-11-19T16:04:34.034500Z

Configure them at the test suite level

plexus 2019-11-19T16:05:29.035200Z

:source-paths defaults to ["src"] and :test-paths to ["test"], so you may not need to configure anything

vikeri 2019-11-19T16:21:03.036700Z

@plexus Alright, I don’t think I have any test suites in my tests.edn. If running kaocha with leiningen, does leiningen’s source-paths somehow interfere?

plexus 2019-11-19T16:47:54.038600Z

there's always at least one test suite. if you don't configure one you get a default one. This is what the default config looks like. You can always see your current actual config with kaocha --print-config

{:kaocha/reporter   [kaocha.report/dots]
 :kaocha/color?     true
 :kaocha/fail-fast? false
 :kaocha/plugins    [:kaocha.plugin/randomize
                     :kaocha.plugin/filter
                     :kaocha.plugin/capture-output]
 :kaocha/tests      [{:kaocha.testable/type    :kaocha.type/clojure.test
                      :kaocha.testable/id      :unit
                      :kaocha/ns-patterns      ["-test$"]
                      :kaocha/source-paths     ["src"]
                      :kaocha/test-paths       ["test"]
                      :kaocha.filter/skip-meta [:kaocha/skip]}]}

plexus 2019-11-19T16:48:33.039300Z

(if you use #kaocha/v1 in your tests.edn you can omit most of those prefixes)

plexus 2019-11-19T16:49:47.040800Z

kaocha will look at source-paths and test-paths from your test suites to find which directories to watch. The test-paths will also be automatically added to the classpath, the source-paths will not, so your source paths need to be configured in your project.clj as well (they would need to be there in any case). Beyond that leiningen's source-paths does not come into play.

plexus 2019-11-19T16:50:45.041200Z

what's your setup and what behavior are you seeing? what operating system?