This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-07-01
Channels
- # announcements (4)
- # babashka (19)
- # beginners (19)
- # calva (24)
- # cider (1)
- # clerk (7)
- # clj-otel (60)
- # clojars (22)
- # clojure (15)
- # clojure-europe (20)
- # clojure-nl (2)
- # clojure-norway (61)
- # clojure-uk (9)
- # clojurescript (18)
- # community-development (3)
- # cursive (3)
- # datahike (4)
- # datalevin (5)
- # emacs (8)
- # off-topic (23)
- # polylith (46)
- # releases (6)
- # spacemacs (8)
- # yamlscript (1)
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


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"https://github.com/matthewdowney/rich-comment-tests has sneaked into our codebase more and more, and it makes much happy
Interesting!
To eval, do you place the cursor after the let
expression ends, and eval previous form?
> 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 require
s as usual, test helpers, etc without fear of conflating tests with production matters.
This is probs old news, but it never stops amazing me. A symbol defined by deftest
is just a function with some special metadata.
Morning!
morning all
Moin!
Morning
Morning
Good morning