This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-19
Channels
- # aleph (8)
- # announcements (43)
- # babashka (43)
- # beginners (62)
- # calva (8)
- # cider (27)
- # clj-kondo (18)
- # cljs-dev (25)
- # cljsrn (16)
- # clojure (51)
- # clojure-europe (6)
- # clojure-nl (14)
- # clojure-spec (7)
- # clojure-uk (39)
- # clojurescript (17)
- # cursive (9)
- # datascript (12)
- # datomic (16)
- # events (1)
- # fulcro (7)
- # funcool (1)
- # graalvm (2)
- # graphql (5)
- # jobs (1)
- # juxt (6)
- # kaocha (9)
- # leiningen (11)
- # luminus (1)
- # malli (1)
- # off-topic (80)
- # other-languages (2)
- # overtone (3)
- # pedestal (5)
- # quil (1)
- # re-frame (6)
- # reagent (1)
- # reitit (4)
- # rewrite-clj (5)
- # shadow-cljs (207)
- # spacemacs (1)
- # specter (4)
- # sql (1)
- # vim (14)
- # xtdb (7)
Data generation question - I have a top-level (map) spec composed of many nested specs and their associated generators at a leaf level. Some of the leaves of the nested structures use the same spec as other leaves, and I need those that share a spec to produce the same values when they generate. Is there any way to have this happen without explicitly writing a generator for the top level spec?
To guarantee properties at the aggregate level, you need to control generation at the aggregate, as a general principle
Iām curious how people integrate instrumentation with testing. Do they create an instrumentation fixture and call it in a :once
block at the top of every test ns? If so, how do you restore instrumentation to its initial state at the end of that fixture?
unstrument
exists to do that
@jake142 I instrument directly at the top of a test file (after the ns
form) and don't bother undoing it. I do it separately from my test fixtures because those are often functions I reuse across multiple test namespaces, whereas the instrumentation that I do (if any) is usually limited to the functions under test in a specific namespace.