-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support running Jasmine in Nashorn #569
Comments
The code of Jasmine does not depend on Take a look at |
Just to clarify a little what I'm having trouble with: I'm not using a node.js style module packaging. Therefore this code is blowing up: if (typeof module !== 'undefined' && module.exports) {
return exports;
} else {
window.jasmineRequire = window.jasmineRequire || {};
return window.jasmineRequire;
} IMO there shouldn't be any assumptions about how Jasmine registers itself. It would be a bit easier to configure if it used something like: (function(scope) {
// ...register Jasmine
})(this); Which would evaluate in Nashorn to "register things in global scope" just like using I can, of course, create a |
I had the same issue and resolved it in a similar way. I do not understand how the boot.js file can help, because the jasmin.js file is loaded first. Am i missing something? I used the 2.0.0 release from here. |
@jbrisbin is right. That first block is in It's in the function We should probably do something like
This would allow other environments to load a file before |
Sounds good to me. Thank you! |
Here's the story in our backlog. |
Maybe it will be useful to take a look at my post about running |
I started working on JUnit to JavaScript testing support using Java 8 and Nashorn [1]. I quickly found that Jasmine is not plug-and-play in a stock Nashorn environment. In particular, the use of
window
andwindow.onload
is problematic and requires a shim.I'll fork Jasmie itself and do the hacks but it would be nice if there was a way to support Nashorn OOTB without a browser emulator shim because the JS that I'll be testing will never see a browser (ever), so there's no point in making Jasmine think that's where it is.
[1] - https://github.com/reactor/reactor-js
The text was updated successfully, but these errors were encountered: