Q: Jasmine, require and play framework Im really stuck now with the play framework and the jasmine plugin made by the guardian newspaper, https://github.com/guardian/sbt-jasmine-plugin.
I have gotten jasmine to run with play test, but i get issues because of require.
Cases:


*

*Trying to load my app or other modules I want to test in test.dependencies.js.
This results in error MISMATCHED ANONYMOUS DEFINE() MODULES. All my js files are wrapped in define. This means that it all crashes and the test is never run.

*Trying to call define around the describe to call on my modules I want to test in the current specc.
This results in error was: InternalError: Couldn't read source file "./test.js: ./test.js (No such file or directory)". (rjs/r-2.0.1.js#2114).  Its really hard to see where it want to try to load from. But its r-2.0.1.js which creates this error.

*Im trying to call require() on the curent js file I want to test,file is called test right now. 
This results in error was: Error: Module name "test" has not been loaded yet for context: _.
Not sure what I should do.

*Im trying to call require on the current js file, but in absolut path, I want to test.
This results in that it works. BUT only if I write something in the function variables. This can be whatever. If I remove the variable in the function call in define(function(variable) {...}) it results in error was: Error: Module name "test" has not been loaded yet for context: _.

*Trying to require just test, file name is test.js.
This results in error was: InternalError: Couldn't read source file "./test.js: ./test.js (No such file or directory)". (rjs/r-2.0.1.js#2114)
Same weird thing here when a random variable is with or not.

*Trying to require with a variable for the absolute path, so I just have to put it one place.
This results in Error: Module name "path..../test.js" has not been loaded yet for context: _
Meaning that the absolute path is there, but for some reason I get the not loaded. I can even console log the variable before trying to require, and its correct.
The weird thing cannot be resolved with defining an empty list in define. But only with a variable in the function. Unless I actually define something in the define array.
Hope someone have some insight into this. I am really lost.

A: The guardian one is deprecated. The new repo is at https://github.com/joescii/sbt-jasmine-plugin
Have you tried that one?

Edit:
I've also built my own plugin for this purpose: https://github.com/tanin47/sbt-web-test-js
The differences from sbt-jasmine-plugin are:


*

*The testers can be in Coffeescripts

*It uses PhantomJS to execute the test HTML files. sbt-jasmine-plugin uses env-js + Rhino, which, in my opinion, is less robust.

