ClojureScript

The :testing-contexts value does not survive async macro

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

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 (<eval>: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 (<eval>:NaN:28)
expected: (= 0 1)
  actual: (not (= 0 1))

Activity

Andrea Richiardi made changes -
Field Original Value New Value
Summary The :testing-contexts test key does not survive async macro The :testing-contexts value does not survive async macro

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: