Closed ghost closed 8 years ago
Hi @agremm,
Can you include the compiler options? Are you using :optimizations :none
?
Rhino is completely unrelated to Node.js and Karma. Having installed them (or not) should make no difference. Are you saying that it worked with node/kama?
Thanks for your feedback.
I'm using
:compiler {:main 'reacl-tutorial.test-run :asset-path "js/test-out" :output-to "resources/public/js/test.js" :output-dir "resources/public/js/test-out" :source-map-timestamp true :optimizations :simple} as options.
I guess I was just trying to narrow down possible sources of the error when I mentioned Node.js and Karma. I haven't tried using any other JS engine as I only care about Rhino at the moment.
Thanks for your help!
Thanks for the config.
After looking at the reacl-tutorial I see two problems:
(run-tests 'reacl-tutorial.core-test)
is hidden under a run
function. In doo
it must be a top level declaration (Now documented in the README with 1f582ed)Here are the minimal changes I've made to successfully test with Slimer, running lein doo slimer test
. If you'd rather test with Karma let me know and I'll guide you to set it up.
If you would like to test non-DOM functions in Rhino, you'll need a profile that doesn't have reacl as a dependency so it doesn't pull React in.
Hi there,
I work with @agremm and am the primary author of Reacl:
Thanks for the quick reply and the help!
A few comments:
Yes, React can access the DOM, but the code @agremm is trying to run is carefully engineered to not get that point. (We made an earlier version of this run on Nashorn.)
We really, really want to avoid dragging in complicated dependencies like Slimer - making it run on a JVM-based JavaScript is a primary consideration for us. Any help with this is much appreciated!
To clarify on the Karma situation: When I ran lein doo rhino test
I got an error because doo could not find Karma. I just tried replicating the error but was unable to. I assume there were some other mistakes on my side.
@agremm the Karma error was not your mistake, it was #45, which I fixed and pushed yesterday.
@agremm have you tried using the changes that I proposed in the example project on your code? When I ran it, it stops because it can't find React
, due to this line. I'm exposing Rhino errors in b7327b3 so that you can reproduce this.
@mikesperber if you have code that works under Nashorn, then we should start by having an example repository that also works with Rhino, without involving doo
. Then we would now that what you want is in fact possible. After that, I can help you set up the tests hooks around your scripts. Otherwise the issue is: "Running React related code in Rhino" which is not doo
related. On that front, I would first try to figure out how does React attempt to load itself in Rhino, since there are no modules
, define
, window
, require
, or process
objects.
Closed by #58
Hi,
I'm trying to use rhino with doo 0.1.6-SNAPSHOT. I installed nodejs and karma but when running lein doo rhino test I get the following output:
Though, I do include and use (doo-tests 'foo.runner).
Any idea on what I am doing wrong?