Uploaded image for project: 'ClojureScript'
  1. CLJS-2899

The :testing-contexts value does not survive async macro

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects versions: None
    • Fix versions: 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))
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              arichiardi Andrea Richiardi
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: