Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

It seems like the {{:testing-contexts}} is not preserved in the test environment after (or within better) a cljs.test/async test.

Repro:

`
cljs.user=> (require '[cljs.test :as test :refer-macros [deftest is testing async]])
cljs.user=> (deftest test-testing-contexts

   #_=>   (testing "not there"
   #_=>     (async done
   #_=>            (js/setTimeout #(do (is (= 0 1))
   #_=>                                (done))))))

cljs.user=> (test/test-var #'cljs.user/test-testing-contexts)

object[Object]

cljs.user=>
FAIL in (test-testing-contexts) (at applyHandler (:NaN:28)
expected: (= 0 1)
actual: (not (= 0 1))
`

I have also inspected, using {{test/testing-contexts-str}}, the env before and after {{async}} and:

`
cljs.user=> (deftest test-testing-contexts

   #_=>   (testing "not there"
   #_=>     (println "outside ->" (test/testing-contexts-str))
   #_=>     (async done
   #_=>            (println "inside -> " (test/testing-contexts-str))
   #_=>            (js/setTimeout #(do (is (= 0 1))
   #_=>                                (done))))))

cljs.user=> (test/test-var #'cljs.user/test-testing-contexts)
outside -> not there
inside ->

object[Object]

cljs.user=>
FAIL in (test-testing-contexts) (at applyHandler (:NaN:28)
expected: (= 0 1)
actual: (not (= 0 1))
`

1 Answer

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-2899 (reported by arichiardi)
...