Closed fredericlb closed 9 years ago
Perhaps a dupe of #70. Queued, thanks.
Using the example given in here gives the same result:
(defn- timeout-helper
[test-context delay]
(with-test-ctx test-context
(let [now #(.getTime (js/Date.))
t (now)]
(js/setTimeout
(fn []
(is (>= (now) (+ t delay)))
(done))
delay))))
(deftest ^:async timeout
(timeout-helper 2000))
printing the arguments of helper shows that context is 2000 and delay nil.
and cljs is version "0.0-2202" cljs.test version "0.3.1"
and the code is run in phantomjs
@Verneri I found that explicitly passing in -test-ctx
to timeout-helper
solves the issue you're facing.
(deftest ^:async timeout
(timeout-helper -test-ctx 2000))
Perhaps the example in the README was supposed to look like this originally?
Does this still happen under ClojureScript 2411? #70 is no longer a problem under it (and maybe other more recent compiler versions?).
Yes it's fixed now ! Thanks
Hi,
I am not really sure if this is really a bug or if I'm making a mistake but when running this test :
i am told that th following assert failed :
(instance? TestContext test-ctx)
however it looks to me that my code is quite close to the one concerning core.async in the README.
do you have any idea of the reason why this code snippet fails ?
thanks,