lazytest

lread 2024-10-03T15:05:47.577549Z

@lee has joined the channel

dorab 2024-10-03T19:00:53.069169Z

@dorab has joined the channel

2024-10-03T19:27:04.982959Z

a demonstration of set-ns-context!

(ns lazytest.context-namespace-test
  (:require
   [lazytest.core :refer [around before-each defdescribe expect-it
                          set-ns-context!]]))

(def state (volatile! ::baseline))

(set-ns-context!
 [(around [f] (vreset! state []) (f) (vreset! state ::around-after))
  (before-each (vswap! state conj :before-each))])

(defdescribe context-namespace-test
  (expect-it "works"
    (= [:before-each] @state)))

2024-10-03T20:13:25.889469Z

there are some better demonstrations I want to write