This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (1)
- # architecture (3)
- # beginners (31)
- # calva (61)
- # cider (1)
- # clojure (43)
- # clojure-dev (17)
- # clojure-europe (85)
- # clojure-uk (8)
- # clojurescript (31)
- # crux (2)
- # cryogen (2)
- # cursive (7)
- # data-science (12)
- # datalog (1)
- # datomic (4)
- # defnpodcast (1)
- # figwheel-main (11)
- # fulcro (32)
- # hoplon (1)
- # leiningen (1)
- # malli (47)
- # pedestal (1)
- # rdf (2)
- # re-frame (11)
- # reagent (4)
- # reitit (7)
- # shadow-cljs (22)
- # vrac (8)
There was a problem with the last few versions of the program that prevented jack-in. Downgrade to version 2.0.126 and it should be good again. I don't know whether or not this has been fixed yet.
hi all, can some one please advise how to run expectations in calva.. I am running
_"command"_: "calva.runTestUnderCursor", short cut, it does not seem to trigger expectations properly..
How do I evaluate these in repl from calva
(expect ClassCastException (Integer. "99"))
(expect ClassCastException (Integer. 99))
And how to fix broken indentation using calva
(facts "About `first-element` " (fact "it normally returns the first-element 33" (first-element [1 2 3] :default) => 1) (first-element nil :default) => :default)
I don't know for certain that the test runner works with expectations (have not used expectations much, and never with the test runner). It depends I guess on whether cider-nrepl sees the tests. @manas.marthi If you can provide some repo code in an issue where tests are not found that would help.
evalCurrentFormInREPLWindow is no longer a command. I think that was only with the old repl window. What causes this error for you?
Dear Calva-friends: I have found the error with jack-in regression on Windows. It's fixed in this VSIX. Can you windows users run with that and see that it works now? Also Mac and Linux users can test it to check that it doesn't break stuff there. (Jack in to some projects and it should just work as before). https://8470-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.130-827-fix-windows-jack-in-193b17e5.vsix
I've just tested jack-in with a clojure cli project, multi-project folder, and lein+figwheel on arch linux and all worked fine 🎉
Hi @brandon.ringe, The tests are running, but the result of expectations are not being reported.. It is just compiling the form and not doing anything about it
I tried evaluating the form and evaluating the selection.
(expect ClassCastException (Integer. 99)) is not getting reported as a failure..
Hi @pez, I am hoping to remove extra leading spaces and blank lines like below
(facts "About `first-element` " (fact "it normally returns the first-element 33" (first-element [1 2 3] :default) => 1) (first-element nil :default) => :default))
This above test is running fine. When I use the expectations and run the
run test under cursor it is not running
Hi @pez I copied the shortcuts from the link given under "Replace all Calva `ctrl+alt+...` key bindings with `ctrl+shift+...`," part of the wiki. It has that
You need to configure the indentation to work to your taste: https://calva.io/formatting/#configuration (Though I don't think you can make it remove single blank lines.)
What is the expected behaviour of "calva.loadFile", Does it recompile and reload the namespace?
I had two
deftests and then merged both into single
deftest the updated contents work when I run
run test under cursor . But old deftests were running when I ran
run tests in the namespace
Yeah, I don't think it resets the namespace. See if the refresh namespace commands do that for you.
As for tests, I'm thinking that maybe
expect stuff is not seen by
cider-nrepl. Are you using Midje?
I am doing the examples in clojure workshop book by @viebel. The book uses
lein expectations to run expectations. But I was unable to run them from within the vscode. I then started using Midje. I had to run
(autotest) on the repl and the tests are running automatically. I am not running any
run tests in namespace not refresh the namespace like what
midje is doing?
I think maybe the Calva (CIDER) test runner doesn't see Midje tests. Might work better with metosin/testit.
Okay, well for now, midje re running them all with updated sources, so I am okay now with what's going on with the tests
I have one more doubt about executing commands on cursor and the placement of cursor on the next line
(println 1) and I had to hit
ctrl+enter to get it running. The cursor got placed in the line after the arrow in the next cursor
Okay. And alt+enter for expect does not show the output of the assertion. It shows the below output
expect defines something. If you want to execute it, wrap in parens should work.
clj::cljworkshop.core-test=> #'cljworkshop.core-test/expect-1861403530 clj::cljworkshop.core-test=> 1 nil clj::cljworkshop.core-test=> #'cljworkshop.core-test/expect-1861403530 clj::cljworkshop.core-test=>
ctrl+, ctrl+r to
calva refresh. It does not give any feedback message about the result of refresh
Ctrl+Alt+l is doing the job I need. And
Ctrl+A+Del is clearing the buffer. I am good for now. Thank you very much for responding to my queries..
Sean advised that I should be using
expectations/clojure-test instead of classic expectations so that it works from file buffer.. I tried it. It is working fine . Thanks..
Calva version 2.0.130 is out now in the VS Code marketplace. Jack-in should now work on Windows again. If you're using the open source version of vs code - "Code - OSS" the latest version there is still 2.0.129. The publish to Open VSX just started failing so we'll need to fix that in the CI.