angularjs - Can't get sbt-mocha to see Angular webjar mocks library properly -


i can't angular mocks or angular recognized in sbt-web / sbt-mocha project.

i writing sample based on sbt-web play http://typesafe.com/activator/template/play-2.3-highlights highlights sample. killed other plugins left sbt-mocha one.

i declared dependencies in librarydependencies:

librarydependencies ++= seq(   "org.webjars" % "jquery" % "2.1.0-2",   "org.webjars" % "angularjs" % "1.3.0-beta.18",   "org.webjars" % "angular-ui-router" % "0.2.10-1",   "org.webjars" % "squirejs" % "0.1.0" % "test",   "org.webjars" % "chai" % "1.9.1" % "test" ) 

i wrote angular app constant , dropped in assets/javascripts app.js:

angular.module('myapp', [])   .constant('pi', math.pi); 

next, wrote test:

(function() { 'use strict';      describe('angular spec', function() {         beforeeach(module('myapp'));          it('should have app pi', inject(function(pi) {             expect(pi).to.be.defined();         }));     }); }()); 

i fired sbt mochaonly , got:

[error] typeerror: module not function, object.  

now, i've tried using angular.mocks.module , gives me error angular doesn't exist.

i added same library test path, thinking maybe test path isolated main one, (silly idea) didn't help. tried following http://www.scala-js.org/doc/sbt/depending.html include mocks js file this:

  "org.webjars" % "angularjs" % "1.3.0-beta.18" / "angular-mocks.js" % "test", 

but gave me error around "/" , didn't recognize it, strike three...

i've done dozens , dozens of times gulp, grunt, maven maven-jasmine-plugin i'm in sbt-web world, , uses mocha, , there isn't documentation go on. i'm new scala , try going, apologies if don't yet... possible!

i want bootstrap angular mocks library module function, , inject angular asset pi inject.

i have github repo code in it... : https://github.com/krimple/sbt-web-project-with-angular/

anyone want hack on me? i'd love figure out , pull request play seed project angular have mocha tests. better jasmine sbt plugin think we're going have focus on mocha first.

you lack dependency:

"org.webjars" %% "webjars-play" % "2.3.0" 

see if that's issue.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -