Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Async tests broken in ClojureScript 0.0-2234 #70

Closed
weavejester opened this Issue · 5 comments

5 participants

@weavejester

If clojurescript.test 0.3.1 is executed with ClojureScript 0.0-2234, the latest version so far, clojurescript.test fails with an error message for any asynchronous test.

For example, this code:

(ns example.async-test
  (:require [cemerick.cljs.test :as t])
  (:require-macros [cemerick.cljs.test :refer [is deftest testing done]]))

(deftest ^:async foobar (done))

Produces:

Running ClojureScript test: unit-tests

Testing example.async-test

Ran 0 tests containing 0 assertions.
Waiting on 1 asynchronous test to complete.

Testing example.async-test (async)
Error: Invalid arity: 1

The problem appears to be the (done) macro, however because there's no stacktrace, figuring out exactly what is causing the issue has eluded me.

This example works fine with the two previous versions of ClojureScript, 2202 and 2227.

@cemerick
Owner

Thanks, will look at this shortly.

@cemerick cemerick added this to the 0.3.2 milestone
@mynomoto

I can confirm the problem @weavejester reported and using ClojureScript 0.0-2311 it does't return a error but also doesn't run the tests:

(ns example.async-test
  (:require [cemerick.cljs.test :as t])
  (:require-macros [cemerick.cljs.test :refer [is deftest testing done]]))

(deftest ^:async foobar 
  (js/setTimeout
    (fn []
      (is true)
      (done)) 0))

Returns:

Running ClojureScript test: unit-tests

Testing example.async-test

Ran 0 tests containing 0 assertions.
Waiting on 1 asynchronous test to complete.

Testing example.async-test (async)

And the test result is not returned.

@wilkerlucio

I'm having a different issue here, everytime I try an async test I'm getting this:

Testing sm.core-test 

Ran 0 tests containing 0 assertions.
Waiting on 1 asynchronous test to complete.

Testing sm.core-test (async)
"Error evaluating:" (run-tests) :as "cemerick.cljs.test.run_tests_STAR_.call(null,new cljs.core.Symbol(null,\"sm.core-test\",\"sm.core-test\",189573716,null));\n"
Error: nth not supported on this type function Array() { [native code] }
    at cljs.core.nth.nth__2 (cljs/core.cljs:60:9)
    at cljs.core.nth.nth (cljs/core.cljs:134:15)
    at cljs.core.PersistentTreeMap.cljs$core$IMap$_dissoc$arity$2 (cljs/core.cljs:165:20)
    at _dissoc (cljs/core.cljs:9:14)
    at cljs.core.dissoc.dissoc__2 (cljs/core.cljs:13:27)
    at cljs.core.dissoc.dissoc (cljs/core.cljs:60:18)
    at cljs.core.update_in.update_in__4 (cljs/core.cljs:20:41)
    at cljs.core.update_in.update_in (cljs/core.cljs:72:21)
    at cemerick.cljs.test.start_next_async_test (file:/Users/wilkerlucio/Development/sm2/smgui/.repl/cemerick/cljs/test.js:474:58)
    at cljs.core.swap_BANG_.swap_BANG___2 (cljs/core.cljs:11:45)

Using:

[org.clojure/clojure "1.7.0-alpha2"]
[org.clojure/clojurescript "0.0-2342"]
[org.clojure/core.async "0.1.338.0-5c5012-alpha"]
@chadharrington

Thanks for this great project.

This issue is really hampering our development; any idea of timeframe on a fix? Should we find another way to test?

@cemerick
Owner

I was able to confirm this with 2234, but the testcase @weavejester provided (now added to the tests here, see above commit) works as expected under 2411. Appears to have been a transient compiler bug.

Feel free to reopen if there's evidence to the contrary.

@cemerick cemerick closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.