This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-22
Channels
- # announcements (10)
- # babashka (40)
- # beginners (192)
- # calva (9)
- # cider (2)
- # clj-kondo (9)
- # clojure (69)
- # clojure-dev (15)
- # clojure-europe (29)
- # clojure-gamedev (6)
- # clojure-italy (2)
- # clojure-nl (41)
- # clojure-spec (49)
- # clojure-uk (11)
- # clojurescript (68)
- # conjure (1)
- # cryogen (20)
- # cursive (37)
- # data-oriented-programming (10)
- # data-science (4)
- # datahike (7)
- # datomic (8)
- # depstar (14)
- # emacs (7)
- # events (2)
- # figwheel-main (1)
- # fulcro (81)
- # honeysql (22)
- # hugsql (5)
- # juxt (3)
- # leiningen (8)
- # lsp (314)
- # malli (20)
- # meander (15)
- # membrane (20)
- # mid-cities-meetup (11)
- # practicalli (2)
- # reagent (2)
- # remote-jobs (2)
- # ring-swagger (1)
- # rum (3)
- # sci (21)
- # shadow-cljs (52)
- # startup-in-a-month (1)
- # testing (9)
- # tools-deps (41)
- # vim (8)
- # xtdb (4)
is there any easy way to do "beforeEach" blocks for tests?
I'd love to not have to do all of my set-up over and over again for a given batch of tests
You might be looking for use-fixtures
https://clojuredocs.org/clojure.test/use-fixtures
those are per-file, and i was hoping for per deftest
block
even the :each
applies to every single deftest
in a given file
maybe i'll write up a macro to do this for me, lol
the last project I had which had some complex fixture setup tasks we ended up just writing a few helpers functions that we used in the test code that needed it. it felt a bit wrong coming from other environments that really emphasize separating fixtures and tests, but it worked fine
yeah, seems like the best method. thanks