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?
:source-paths
and :test-paths
should be all you need @vikeri
Configure them at the test suite level
:source-paths
defaults to ["src"]
and :test-paths
to ["test"]
, so you may not need to configure anything
@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?
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]}]}
(if you use #kaocha/v1
in your tests.edn you can omit most of those prefixes)
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.
what's your setup and what behavior are you seeing? what operating system?