On 02/14/2014 05:26 PM, Joel Holdbrooks wrote:
On Friday, February 14, 2014 12:54:41 PM UTC-8, Chris Zheng wrote:
Is there a way of doing autotesting of clojurescript code?

I'm using 0.2.2 and when I run lein cljsbuild test, it only seems to test once.

My settings are:

   :cljsbuild {:builds [{:source-paths ["src" "test"]
                        :compiler {:output-to "target/cljs/testable.js"
                                   :optimizations :whitespace
                                   :pretty-print true}}]
              :test-commands {"unit-tests" ["phantomjs" :runner
                                            "this.literal_js_was_evaluated=true"
                                            "target/cljs/testable.js"]}}
Forgot the link, whoops! Here it is: 
http://noprompt.github.io/clojurescript/testing/ruby/2014/01/25/autotesting-clojurescript.html


You don't need external tools for this kind of workflow; lein-cljsbuild provides a :notify-command option that will shell out to whatever you want (including a phantomjs/node/whatever process to run your tests):

https://github.com/emezeske/lein-cljsbuild/blob/master/sample.project.clj#L73

I was reminded of this via https://github.com/cemerick/clojurescript.test/issues/26 (which is re: the fact that :runner, :node-runner, etc are currently only replaced within :test-commands). I'll get that into clojurescript.test right after 0.3.0 (async support) is done.

- Chas

--
Note that posts from new members are moderated - please be patient with your 
first post.
--- You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to