Fork me on GitHub
#clojure-europe
<
2024-05-16
>
thomas08:05:20

Good morning

teodorlu08:05:42

I learned recently that @magnars has hooked his Emacs to run all the tests each time he evaluates an expression. So he redefines some code (eg C-c C-c in emacs), then all the tests run instantly, and he sees something green in his editor if tests pass, something red otherwise.

vemv12:05:23

Sadly, in most projects out there, tests aren't precisely instantaneous and there isn't even a (non ad-hoc) categorization. so that you can choose to run the true unit tests first. So in practice this tends to introduce a delay that can get old pretty fast!

teodorlu12:05:40

I guess that can also be seen as an argument for keeping the tests as close to instant as possible!

1
vemv12:05:34

Yes. In practice it can be an upstream battle in team settings - at this point I kind of gave up for those kinds of battles

👍 1
magnars12:05:01

The tricks is to not be like most projects 😅

💯 3
simongray08:05:35

@teodorlu Sounds similar to how testing works in shadow-cljs

👍 1
teodorlu08:05:55

how does testing work in shadow-cljs? (never used testing in shadow-cljs, only tried it briefly)

simongray08:05:24

A tab in your browser contains the results of the tests, its favicon is either red or green. Tests are run whenever you edit the code, similar to how the app is rerendered.

👍 1
pez08:05:14

shadow-cljs is more test-on-save, isn’t it?

teodorlu09:05:12

> shadow-cljs is more test-on-save, isn’t it? To be pedandic, magnar’s workflow is not test on save — it’s all in the REPL.

pez11:05:58

hot-reload blurs the lines a bit.

yes 1
maleghast09:05:02

madainn mhath :flag-scotland:

genRaiy17:05:27

Good morning

❤️ 6