Fork me on GitHub
#kaocha
<
2021-10-05
>
danielgrosse09:10:21

I'll invoke it with a bin/kaocha file as described in the quickstart.

#!/usr/bin/env bash

clojure -A:test -m kaocha.runner "$@"
my deps edn
{:paths ["src", "resources"]
 :deps {ring/ring-jetty-adapter {:mvn/version "1.9.4"}
        ring/ring-defaults {:mvn/version "0.3.3"}
        metosin/reitit {:mvn/version "0.5.15"}
        ring-cors/ring-cors {:mvn/version "0.1.13"}

        ;; Database
        com.github.seancorfield/next.jdbc {:mvn/version "1.2.724"}
        org.postgresql/postgresql {:mvn/version "42.2.2"}
        com.h2database/h2 {:mvn/version "1.4.199"}
        com.layerware/hugsql-core {:mvn/version "0.5.1"}
        com.layerware/hugsql-adapter-next-jdbc {:mvn/version "0.5.1"}}

 :aliases {:run {:main-opts ["-m" "maps.core"]}
           :test
           {:paths ["test/cljt"]
            :extra-deps {lambdaisland/kaocha           {:mvn/version "1.0.887"}
                         lambdaisland/kaocha-cloverage {:mvn/version "1.0.75"}}}}}
the directory tree
src
└── clj
    ├── core.clj
    ├── db
    │   ├── sql
    │   │   └── views.sql
    │   └── views.clj
    ├── db.clj
    ├── handler
    │   ├── location.clj
    │   └── view.clj
    └── routes.clj(
test
├── clj
│   └── unit
│       ├── core_test.clj
│       └── handler
│           ├── location_test.clj
│           └── view_test.clj
There are more files but not related to clojure

dharrigan09:10:06

From glancing at your setup, it does look like your namespace isn't correct. You have, in your deps, that path being src, yet, underneath that you have the structure clj/handler/view.clj, which would suggest to me that your namespace should be clj.handler.view, not handler.view, which is why the compiler can't find handler/view.clj, as it's expecting clj/handler/view.clj

dharrigan09:10:03

in your tests.edn, you have the path correct, i.e., source-paths ["src/clj"], but in your deps.edn, you just have src.

practicalli-johnny13:10:50

The :test alias also has a slight error in the path, it says test/cljt rather than test/clj Unless the project will have Clojure common and ClojureScript files, I suggest simplifying the paths and removing the clj directories from under src and test directories

danielgrosse20:10:37

After adding the clj to the src path and removing the test path property the tests are now running. Thanks for your help

👍 1
1