When using stest/instrument
in tests, how do you clean up after a test? e.g.
`
(deftest foo
(stest/instrument
foo {:stub
foo})
unstrument
right, but you don’t know what the previous state was
was it instrumented, or stub+ instrumented?
Sorry, not understanding the question
We have some code that is always instrumented. During a test, if I call (instrument
foo {:stub foo})
, that overwrites the existing instrument with a stub+instrument. Now if I call unstrument
at the end, the next test will run with foo
un instrumented
Instrument remembers the old var and unstrument replaces it iirc
@arohner I have some code to deal with that: https://github.com/borkdude/respeced#with-instrumentation