cemerick / clojurescript.test

A maximal port of `clojure.test` to ClojureScript. DEPRECATED
165 stars 32 forks source link

Duplicate summary output #66

Closed mikesperber closed 10 years ago

mikesperber commented 10 years ago

I've been seeing duplicate output of the form "Ran XX tests containing XX assertions." on each test run. (On Nashorn, by the time the second one runs, squelch-internals has run, and that causes an exception, but I'll file a separate issue on this. But I also see the duplicate output with Slimer.)

Looking at the code, I see this:

(defn ^:export run-tests*
  ... 
 [& namespaces]
  (let [[test-env & namespaces] (if (instance? cljs.core.Atom (first namespaces))
                                  namespaces
                                  (cons (init-test-environment) namespaces))]
    (test-runner-entry-point
     test-env
     (doseq [ns (distinct namespaces)] (test-ns test-env ns))
     (on-testing-complete test-env test-summary)
     (test-summary test-env))))

There's on invocation of test-summary via on-testing-complete, and another direct invocation. This seems intentional, but I can't see why it's there.

cichli commented 10 years ago

Hiya, this should be fixed by PR #62. Basically, the results are printed for synchronous tests only, and then after the asynchronous tests have completed the results are printed again (for sync + async). As it is right now, having no async tests means that the results will be immediately duplicated.

cichli commented 10 years ago

Btw, this issue is a duplicate of #61 :).

mikesperber commented 10 years ago

Yup, sorry for not seeing this. Thanks for looking!

cichli commented 10 years ago

No problem. :+1:

cemerick commented 10 years ago

Yes, #62 should fix this. Closing.