Fork me on GitHub

Hi everyone. I'm new to Calva and trying to create an efficient workflow. I have a shadow-cljs project, with some unit tests (using a :node-test target in shadow-cljs.edn) and it's running my tests fine. I'm, trying to see what Calva can do for unit testing, but when I connect to my running :node-test repl, and try to run namespace tests with Calva, I always get "No tests found". Same thing if I try to run a specific test. In addition to the no tests found message, I always see the following message: "No application has connected to the REPL server. Make sure your JS environment has loaded your compiled ClojureScript code.". My project is a NodeJS project, not a browser project. Any hint on what I'm doing wrong?


Calva can't run shadow-cljs tests, yet. I don't right now remember what is the problem, but it probably is something with how tests are discovered by cider-nrepl. What I do is that I have :auto-run true on the test target. See Calva's shadow-cljs.edn for an example:


Then when I jack in I tell Calva to start both builds, but I connect to the node library one and have the jack-in terminal visible as I work with the code.


As for the ”No application has connected” message... It's tricky without knowing more about your project config and how you start the app. Can you elaborate some?


Hi, my team uses CIDER, Cursive and (increasingly) Calva. I can't work out how to get a 2-space indent though, so all our PRs are full of whitespace changes. Here's what I'm after:

(defn add [x y]
  (+ x y)) ;; perfect

(rf/reg-sub :sum-x-y
            (fn [db] (add (:x db) (:y db)))) ;; no, too far!
I can find lots of discussion about this kind of thing but so far not the answer, I would be super grateful if someone could point me in the right direction?


A way of always using 2-space indent for everything would be fine


Hi, @conan. This is currently not possible with Calva. There is a PR that is starting to add it, but it is sonewhat dormant. I have merged that PR into a branch and am trying to find time for it. This branch: If you have some time to look at it, I'd be happy to give you some pointers on where to dig.


Ah ok, thanks very much. I may have some time, do you think it would be a lot or a little work?


perhaps more importantly, is it typescript or clojurescript work?