javascript - Jasmine, require and play framework -


im stuck play framework , jasmine plugin made guardian newspaper, https://github.com/guardian/sbt-jasmine-plugin.

i have gotten jasmine run play test, issues because of require.

cases:

  1. trying load app or other modules want test in test.dependencies.js. results in error mismatched anonymous define() modules. js files wrapped in define. means crashes , test never run.

  2. trying call define around describe call on modules want test in current specc. 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). hard see want try load from. r-2.0.1.js creates error.

  3. im trying call require() on curent js file want test,file called test right now. results in error was: error: module name "test" has not been loaded yet context: _. not sure should do.

  4. im trying call require on current js file, in absolut path, want test. results in works. if write in function variables. can whatever. if remove variable in function call in define(function(variable) {...}) results in error was: error: module name "test" has not been loaded yet context: _.

  5. trying require test, file name test.js. 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 random variable or not.

  6. trying require variable absolute path, have put 1 place. results in error: module name "path..../test.js" has not been loaded yet context: _ meaning absolute path there, reason not loaded. can console log variable before trying require, , correct.

the weird thing cannot resolved defining empty list in define. variable in function. unless define in define array.

hope have insight this. lost.

the guardian 1 deprecated. new repo @ https://github.com/joescii/sbt-jasmine-plugin

have tried one?


edit:

i've built own plugin purpose: https://github.com/tanin47/sbt-web-test-js

the differences sbt-jasmine-plugin are:

  1. the testers can in coffeescripts
  2. it uses phantomjs execute test html files. sbt-jasmine-plugin uses env-js + rhino, which, in opinion, less robust.

Comments

Popular posts from this blog

HTTP/1.0 407 Proxy Authentication Required PHP -

curl - PHP fsockopen help required -

c# - Resource not found error -