Fork me on GitHub
#nbb
<
2024-06-25
>
jaide13:06:16

Haven't pinned down what's preventing the testing macro from working as expected

jaide14:06:52

New theory: Maybe this new-env function is firing but testing-contexts is not being referenced?

jaide14:06:12

I think that might be it. I replaced the fail reporter with:

(defmethod t/report  [:cljs.test/default :fail] [m]:bulb:
  (t/inc-report-counter! :fail)
  (inc-var-count! :fail)
  (println "\nFAIL in" (t/testing-vars-str m))
  (println "testing contexts" t/*testing-contexts*)
  (when (seq (:testing-contexts (t/get-current-env)))
    (println (t/testing-contexts-str)))
  (when-let [message (:message m)] (println message))
  (print-comparison m))
The output:
FAIL in (basic-test) (:47)
testing contexts (Will this work? Can test with promise)
expected: (= x 3)
  actual: (not (= 2 3))
Looks like the empty-env is initializing testing-contexts to an empty list, but the testing macro is operating on the dynamic *testing-contexts* var