tonsky / Clojure-Sublimed

Clojure support for Sublime Text 4
MIT License
359 stars 22 forks source link

Tweak example code in readme for running tests #88

Closed ghost closed 1 year ago

ghost commented 1 year ago

I found that the prior example led to a very noisy test report in my terminal, which made it a chore to scroll to the output of the specific test ns I was working on. I suspect this might be a better default for folks like me who may not be experts in the machinery of clojure.test and the various ways to run the tests, etc.

tonsky commented 1 year ago

Thanks! I added a tip in the readme

einars commented 1 year ago

A bit of bikeshedding, but you could shorten to (clojure.test/run-tests) β€” without args it already defaults to running on current namespace, without any extra need for re-patterns.

ghost commented 1 year ago

@einars great point! Thanks!

I also noticed that the command clojure_sublimed_eval_code always displays a βœ… in the status bar if the evaluation succeeds β€” which includes of course even the case when one or more tests failed or errors were thrown.

So I’m currently rocking this:

{"keys": ["ctrl+t"],
 "command": "clojure_sublimed_eval_code",
 "args": {"code": "(let [{:keys [fail error] :as res} (clojure.test/run-tests)] (str (when (or (pos? fail) (pos? error)) \"🚨🚨🚨🚨🚨🚨🚨🚨 \") res))"}}

which might seem excessive but personally, I really needed the excessiveness so that the 🚨 would very obviously β€œovershadow” the βœ… and get my attention.