Fork me on GitHub
#emacs
<
2016-01-28
>
peeja15:01:21

Are there any popular tools for running clojure tests automatically/continuously in emacs?

yenda15:01:54

autotest.clj ?

jethroksy15:01:41

I like to do my testing in the terminal

jethroksy15:01:54

why do it in emacs?

yenda15:01:07

why not, emacs is an os

jethroksy15:01:32

I'd just do it in eshell

yenda15:01:35

in the parens of the dead webcast emacsrock! does autotests in a buffer, maybe it's a shell buffer idk

yenda15:01:03

the workflow in the web cast is epic but it's a shame, it is barely explained and not documented afaik

jethroksy15:01:29

most of the magic is from clj-refactor

yenda15:01:06

which sadly doesn't seem to work in cljs

jethroksy15:01:45

a lot of his work in parens of the dead is in cljs though?

yenda15:01:23

no not much

yenda15:01:28

all the logic is in clj

jethroksy15:01:47

I guess you could do that ^

jethroksy15:01:03

I use boot so I just do

(deftask exp []
  (comp
     (watch)
     (expectations)))

jethroksy15:01:14

then I run boot exp in a shell

peeja15:01:23

Iiiinteresting

jethroksy15:01:31

everytime I save a file my tests rerun

peeja15:01:55

I guess, to be fair, what I really care about is cljs, since that's where I'm already looking at code on one half of the screen and a browser on the other

peeja15:01:15

which is why I don't want to also keep switching to a terminal to run tests simple_smile

peeja15:01:33

Something like that cljs-autotest.el might do nicely

jethroksy15:01:46

You wouldn't have to

jethroksy15:01:01

C-x 2 and run boot exp

jethroksy15:01:15

but well whatever floats your boat

peeja15:01:31

Oh, yeah, I guess so

peeja15:01:41

Ideally, I'd want something that got out of my way while it was green

jethroksy15:01:57

ah that would be handy indeed

jethroksy15:01:07

my tests run in the background

jethroksy15:01:18

there are notify and speak tasks

jethroksy15:01:34

so you hear an alarm when your tests go bad

peeja15:01:34

Ideally, I'd want something that got in my way when it was red 😉

peeja15:01:46

notify might be enough, though

jethroksy15:01:58

that's only if you're using boot

jethroksy15:01:03

I haven't touched lein in a while

peeja15:01:18

Yeah, I'm on lein. But I'm sure something like that's still possible

jethroksy15:01:11

have you seen doo?

peeja15:01:29

Yeah, that's where I'm trying to move our tests to

peeja15:01:47

Does it have any integration-y support? Or does it just do lein doo?

jethroksy16:01:22

doesn't seem like there's a package that integrates it into emacs as of yet

jethroksy16:01:34

you could look into inf-clojure's code for parsing input

jethroksy16:01:01

lein doo does have a watch mode

peeja16:01:16

Yeah, that might be enough

jethroksy16:01:47

for emacs people it's never enough xD

peeja16:01:57

Yeah…

jethroksy16:01:21

my elisp is terrible so I can't help here

malabarba16:01:34

@peeja I don't know how Magnar implemented it, but here's how I do auto-testing http://endlessparentheses.com/test-driven-development-in-cider-and-emacs.html

malabarba16:01:35

I prefer to run tests whenever I do load-file, instead of whenever I save

peeja16:01:43

Ooh, thanks!