On 01/23/2014 12:03 AM, Michael Glaesemann wrote:
On Jan 21, 2014, at 21:07, Michael Glaesemann wrote:

On Jan 21, 2014, at 15:20, Chas Emerick wrote:

Correct, clojurescript.test only supports phantomjs and phantomjs-compatible 
environments (e.g. slimer and derivatives) at the moment.  As noted in the 
README, runners for other environments (including node.js) are very welcome!
Nikita, Chas,

Thanks for the feedback. I understood that there's only a phantomjs runner, but 
I guess I didn't fathom the full implications. I'll see what I can do with a 
nodejs runner.
I've got a basic nodejs runner working:

https://github.com/grzm/clojurescript.test/commit/7622545b114b50f55c707b58623f5ed84699e105

It only works with :advanced compilation. Using :simple and :whitespace gives 
this error:

[TypeError: Cannot set property 'Unicode' of undefined]

Looks similar to the error reported here: 
http://dev.clojure.org/jira/browse/CLJS-101

That said, here's the relevant sections of my project.clj:

   :cljsbuild {:builds
               {:test {:source-paths ["src/cljs" "test"]
                       :compiler {:output-to "target/test.js"
                                  :optimizations :advanced
                                  :pretty-print true}}}
               :test-commands {"unit-tests" ["node" "resources/nodejs_runner.js"
                                             "target/test.js"]}}

Note in this case I have nodejs_runner.js in resources, not in the 
clojurescript.test tree.
I'd be happy to work this up into a proper pull request. What additional work 
would you like me to do?

Thanks!

Michael Glaesemann
grzm seespotcode net

Nice, thanks for digging in!

It looks like you're not yet accommodating arbitrary JS expressions, which can appear in the test command vector; this is documented here:

https://github.com/cemerick/clojurescript.test#configuring-tests-via-javascript-filesexpressions-in-test-commands

Once you have that put together, I'd be very happy to see a PR. If you could place the runner as a sibling of the existing runner.js script, that'd be great. For extra credit, you could modify the clojurescript.test project middleware to (a) dump the node runner to its own temp file, and (b) swap s/:node-runner/"$PATH_TO_NODE_RUNNER" in the project map to match what's being done for the phantomjs :runner placeholder.

Thanks,

- 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