Fork me on GitHub
#clojure-europe
<
2024-07-01
>
schmalz06:07:46

Morning all.

vemv07:07:18

Morning! Starting the day happy that I ported some of my own comment s to deftests that can be run both as deftests and as a single eval. That way one gets the best of both worlds - cleanliness and formalism at test time, and iterativity at dev time

nice 2
thinking-face 1
vemv07:07:44

Structure is nothing fancy

(deftest blah-test
  (let [foo ,,,
        bar ,,,]
    (is (,,, foo))
    (is (,,, bar))
    {:foo foo
     :bar bar}))
it returns a value, so that I can inspect it with a visual tool of choice One has to take care of a few things, like not doing too much work on fixtures, or at least doing equivalent work in "dev seeds"

imre08:07:11

Nice one. What are dev seeds?

danieroux09:07:35

https://github.com/matthewdowney/rich-comment-tests has sneaked into our codebase more and more, and it makes much happy

👀 1
teodorlu10:07:24

Interesting! To eval, do you place the cursor after the let expression ends, and eval previous form?

vemv12:07:11

> What are dev seeds? 'Seeds' as in Rails lingo - any DB insertion that adds 'seed' data - an admin user for example > To eval, do you place the cursor after the let expression ends, and eval previous form? Yep! Exactly. I had tried the rcf library before and found that it brought too much complexity to the src/ dir. A comment with a large prelude of requires isn't pretty. And neither is requiring-resolve With vanilla tests one uses requires as usual, test helpers, etc without fear of conflating tests with production matters.

💯 1
1
slipset08:07:48

This is probs old news, but it never stops amazing me. A symbol defined by deftest is just a function with some special metadata.

👍 1
maleghast08:07:38

madainn mhath :flag-scotland: