On Monday, January 5, 2015 9:38:10 PM UTC+1, stephanos wrote:
> Hey there,
> 
> I'm working on an Om application that can also be rendered on a Node server. 
> So I set up my build to compile a app-node.js file that includes react.js via 
> :preamble. 
> 
> To run tests on the output I need to start the speclj(s) test runner:
> 
>     var app = require("../../target/testable-node.js");
>     app.speclj.run.standard.armed = true;
>     return app.speclj.run.standard.run_specs(
>        app.cljs.core.keyword("color"), true
>     );
> 
> But since React exports itself via 'module.exports' I can't access the 
> 'speclj' and 'cljs' JavaScript objects. I'd love to overwrite the react.js 
> export but I can't for the life of me figure it out:
> 
>     (ns app.server.export
>         (:require [speclj.core]))
> 
>      (aset module.exports "speclj" ???)
> 
> How can I export the 'speclj' object?
> 
> Stephan

Okay, I fixed it by moving the JavaScript code *into* the ClojureScript code:

   (ns app.server.core-spec
       (:require [speclj.run.standard :as speclj]))

   (defn -main [& args]
      (set! speclj/armed true)
      (speclj/run-specs :color false))

   (set! *main-cli-fn* -main)

-- 
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