This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-05
Channels
- # beginners (46)
- # calva (89)
- # cider (24)
- # clara (7)
- # clj-kondo (36)
- # clojure (33)
- # clojure-australia (4)
- # clojure-dev (9)
- # clojure-europe (15)
- # clojure-israel (1)
- # clojure-nl (1)
- # clojure-uk (13)
- # clojurescript (55)
- # community-development (38)
- # conjure (1)
- # cryogen (12)
- # cursive (16)
- # data-science (4)
- # datomic (39)
- # events (2)
- # fulcro (5)
- # gorilla (3)
- # introduce-yourself (3)
- # jobs (9)
- # kaocha (5)
- # malli (16)
- # music (12)
- # off-topic (11)
- # polylith (4)
- # react (4)
- # reactive (1)
- # reagent (18)
- # remote-jobs (2)
- # reveal (2)
- # sci (4)
- # shadow-cljs (31)
- # timbre (4)
- # tools-build (70)
- # tools-deps (11)
- # vim (33)
- # xtdb (53)
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 clojureFrom 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
in your tests.edn
, you have the path correct, i.e., source-paths ["src/clj"]
, but in your deps.edn, you just have src
.
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
After adding the clj
to the src path and removing the test path property the tests are now running. Thanks for your help