This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-19
Channels
- # announcements (12)
- # aws (17)
- # babashka (6)
- # beginners (40)
- # cider (14)
- # cljs-dev (14)
- # cljsrn (8)
- # clojure (110)
- # clojure-europe (46)
- # clojure-italy (1)
- # clojure-nl (4)
- # clojure-spec (14)
- # clojure-sweden (3)
- # clojure-uk (29)
- # clojurescript (52)
- # conjure (68)
- # cursive (33)
- # datomic (9)
- # figwheel-main (11)
- # fulcro (97)
- # ghostwheel (1)
- # graalvm (2)
- # helix (53)
- # hoplon (13)
- # joker (6)
- # kaocha (1)
- # leiningen (2)
- # meander (28)
- # mid-cities-meetup (1)
- # observability (1)
- # off-topic (112)
- # pathom (6)
- # pedestal (3)
- # re-frame (16)
- # reagent (16)
- # reitit (2)
- # shadow-cljs (27)
- # spacemacs (2)
- # sql (26)
- # testing (3)
- # utah-clojurians (3)
- # vim (2)
- # xtdb (32)
@srijayanth i've been thinking about this recently. i develop a game that uses an atom as the "game state", and have a test macro called do-game
that takes a state created with a (new-game ...)
function, and then binds it in a let block with a consistent name (`state`), binds a bunch of helpful functions so you don't have to type state
in everywhere, and then ~@body
all of the enclosed test expressions, so the set up is taken care of easily
this gets awkward when i have to set up the same "initial state" for multiple tests, so i've been experimenting with another anaphoric macro that lets me do a before
binding and insert a single state
into each (testing)
wrapper in my deftest
i don't think this is very idiomatic, because of the focus on non-mutating functions, but sadly my game engine is full of mutation lol