This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-29
Channels
- # aleph (3)
- # announcements (29)
- # babashka (99)
- # beginners (30)
- # calva (46)
- # cider (9)
- # clara (1)
- # cljsrn (4)
- # clojars (10)
- # clojure (41)
- # clojure-dev (4)
- # clojure-europe (45)
- # clojure-nl (3)
- # clojure-norway (13)
- # clojure-uk (5)
- # clojurescript (61)
- # community-development (11)
- # cursive (10)
- # data-science (1)
- # events (1)
- # fulcro (17)
- # graphql (1)
- # gratitude (1)
- # holy-lambda (1)
- # jobs (4)
- # jobs-discuss (5)
- # meander (22)
- # off-topic (50)
- # pedestal (3)
- # re-frame (3)
- # reagent (3)
- # reitit (82)
- # releases (2)
- # rewrite-clj (14)
- # shadow-cljs (3)
- # spacemacs (14)
- # tools-deps (7)
- # xtdb (33)
i’m considering using rewrite-clj to rewrite/rearrange my test suite. it’s currently written in the philosophy of “few deftest
s, many testing
branches”, which makes running specific branches hard. i’m looking to pluck each testing
branch out of the deftests and then place them in a new deftest
with some name. would this be possible with rewrite-clj?
@nbtheduke That is something that I've thought about too: it's better to have more deftests rather than single big tests: it's much easier to invoke them separately.
yeah, it’s also an issue when our tests are really long, so some of these files are 4k or 5k lines long lol
wondering if the rewrite-clj.paredit
would be a good fit, I've never used it but the task sounds 'paredit-y' to me
two phases: first move all testing
s to the top-level, then wrap each one with deftest
might be more complex than that though depending on the usage patterns
If it's a truly one-off thing I might do the last finishing touches with IDE paredit, sounds cheaper than coding sth fine-grained. @nbtheduke
if this was purely string manipulation, i’d probably do it with a thread last that filters to deftest blocks, then group by the deftest name, then plucks each testing
block, then mapcats with some sort of “wrap each block in a deftest”, then prints them out
seems like there’s not any sort of sequencing/mapping over zlocs
@nbtheduke Sometimes I find it easier to ignore the whole zipper stuff and just work directly with the nodes and :children
oh yeah? cool, which part is that?
oh, found the node api
yeah, this is much more my speed. cannot believe all of these cool apis exist
so lucky to work in clojure