This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (26)
- # babashka (58)
- # bangalore-clj (1)
- # beginners (48)
- # bitcoin (1)
- # chlorine-clover (9)
- # clara (7)
- # clj-kondo (11)
- # cljs-dev (10)
- # cljsrn (36)
- # clojars (11)
- # clojure (161)
- # clojure-europe (39)
- # clojure-italy (2)
- # clojure-nl (6)
- # clojure-uk (14)
- # clojured (1)
- # clojurescript (38)
- # conjure (25)
- # core-async (18)
- # cursive (19)
- # datascript (9)
- # datomic (11)
- # emacs (10)
- # events (2)
- # figwheel-main (2)
- # fulcro (44)
- # funcool (5)
- # girouette (1)
- # graalvm (6)
- # jobs (1)
- # lsp (93)
- # malli (3)
- # membrane (3)
- # off-topic (17)
- # pedestal (2)
- # polylith (12)
- # re-frame (2)
- # remote-jobs (1)
- # shadow-cljs (47)
- # specter (2)
- # startup-in-a-month (1)
- # tools-deps (4)
Is there a command to run a test using conjure? As in a single test defined by
Nope, I'm afraid that's just eval at mark. You could set an eval at mark to call a specific form that executes your tests though. Or add your own mapping that goes to the mark, runs the test and hops back? I could look into adding a generic mapping for this but not sure how it'd fit in with the others :thinking_face:
I'm also wondering about that. So what I want is to be able to run an specific test after changing other parts of the code (same use as the eval at mark). But tests do not work in the same way and more setup is necessary. I would argue that it would be good for developer ergonomics even if this is not a general thing (I don't think that every command should have a eval at mark version)
let g:conjure#client#clojure#nrepl#test#current_form_names = ['deftest', 'defexpect']
That is cool, I will add to my config. I have been years since I used expectations, currently I use a plain
deftest and the nubank/matcher-combinators` library for useful machers.
I possible improvement would be eval the test form before running the test, I found surprising that it ran the version without changes of the test form.
I tried to avoid any sort of automatic eval since it could cause HUGE problems for people, it's in the realms of dangerous depending on what you're doing. Being able to run a test, then eval, then test again to see changes can be useful too.
There's no one solution that fits everyone for this sort of thing, so I try to go with the safer option then let users add custom mappings that do this sort of thing where required.
I understand the tradeoffs, maybe adding docs on how to create custom mappings composing commands would help.
Hmm, maybe, although that's kinda just normal vim things. Like
nmap <localleader>G :ConjureLogResetSoft<cr>:ConjureEvalCurrentForm<cr> gives you a mapping that resets the log before each eval
There's nothing Conjure specific here, but I could maybe provide some examples? Or even a wiki page that people stick their interesting config in
Yeah, I think that would help. Usually there are many ways to do things in in vimland depending on what the plugin exposes and not every vim user knows how to customize things on their own.
I just realised the command to run the test under the cursor had an
s on the end, making it sound like it ran many tests, not one. I've just fixed that on develop, so it'll be
nmap <localleader>T :ConjureEvalRootForm<cr>:CljRunCurrentTest<cr> to get the behaviour you want, although you probably want to do this buffer local under a filetype autocmd.
Buffer local under a filetype autocmd is the sort of thing that I think could help people. I know that is not directly conjure related but it helps using conjure the way it should be used.
I learned almost everything I know about configuring vim by copying other people configs and then trying to understand how that works. Certainly not optimal but gets the job done. Nice examples help a lot for that.
Yeah I get that, makes sense. I can try to find time to do some more general documentation like that, I'm just already kinda stretched to my breaking point with work/life/oss, so no promises I'm afraid. If people write up posts / wiki entries I'll gladly share them around, but I'm struggling to find time for myself at the moment.
Sure, I will try to help, answering questions here helps a lot, I'm really thankful for your work on conjure.