guardian / sbt-jasmine-plugin

An SBT plugin for running jasmine tests in your build.
23 stars 28 forks source link

This plugin, play 2.1.1 and require JS #13

Closed vongohren closed 7 years ago

vongohren commented 11 years ago

m really stuck now with the play framework and the jasmine plugin you guys have made.

I have gotten jasmine to run with play test, but i get issues because of require.

Cases:

Case 1#: 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.

Case 2#: 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.

Case 4#: 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.

Case 4#: 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: _.

Case 5#; 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.

The weird thing cannot be resolved with defining an empty list in define. But only with a variable in the function. Unless I actully define something in the define array.

Hope you have time to help me because im really lost!