This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-17
Channels
- # beginners (70)
- # boot (4)
- # cider (16)
- # clara (6)
- # cljdoc (21)
- # cljs-dev (2)
- # cljsrn (1)
- # clojure (73)
- # clojure-finland (2)
- # clojure-nl (6)
- # clojure-russia (35)
- # clojure-sg (1)
- # clojure-spec (14)
- # clojure-uk (146)
- # clojurebridge (2)
- # clojurescript (128)
- # cryogen (2)
- # cursive (20)
- # datomic (27)
- # emacs (6)
- # events (8)
- # figwheel-main (57)
- # fulcro (46)
- # hoplon (3)
- # hyperfiddle (2)
- # immutant (3)
- # jobs (6)
- # jobs-discuss (15)
- # juxt (2)
- # off-topic (33)
- # parinfer (2)
- # portkey (4)
- # protorepl (1)
- # re-frame (4)
- # reagent (78)
- # ring-swagger (45)
- # schema (6)
- # shadow-cljs (167)
- # spacemacs (2)
- # specter (13)
- # tools-deps (6)
I think both are working by swapping vars, so probably, but it might get weird. try it and see.
Seems like it is when the with-redefs
happens before the instrument. But I've got mixed feelings about this idea 😄
Probably better not to do that
Is this a common pattern: isolate a fn by stubbing everything else and running stest/check on it.
(defn check-all []
(let [syms (stest/instrumentable-syms)]
(doseq [sym syms]
(let [stub-syms (disj syms sym)]
(stest/instrument stub-syms {:stub stub-syms})
(stest/summarize-results (stest/check sym))
(stest/unstrument)))))
First time I’ve seen it, but interesting
I was thinking it would give you confidence that the inputs and outputs through the code match up. So essentially a cheap type checking substitute. The downside of that approach is that for full code coverage the generated data needs to trigger all branches of conditionals… I think that’s probably not something you can rely on.
Looks like it isn't an option, but curious if there's a way to specify an fspec for check
like you can for excercise-fn
My goal is to check a fn with an fspec whose :fn
is specific to a more narrow generator.
you can do that with instrument
first
with the :replace
functionality
if I understand your goals that is