guardian / sbt-jasmine-plugin

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

Error when using AngularJS > 1.2.20 #20

Open franbh opened 9 years ago

franbh commented 9 years ago

Hello, I'm trying to use the last version of this plugin (1.3.0) in order to run Jasmine tests using AngularJS and RequireJS. It works perfectly when using AngularJS 1.2.20, but an error occurs when using any AngularJS version greater than 1.2.20.

The following is the error trace:

error running jasmine test: /data/desarrollo/sources/svn/wr/attic/poc-sbt-jasmine/src/test/webapp/static/js/specs/contracts/models/organizationModel.spec.js error was: TypeError: Cannot find function querySelector in object [object HTMLDocument]. at script(/data/desarrollo/sources/svn/wr/attic/poc-sbt-jasmine/src/main/webapp/static/js/lib/angularjs_1.3.4/angular.js:936) at script(/data/desarrollo/sources/svn/wr/attic/poc-sbt-jasmine/src/main/webapp/static/js/lib/angularjs_1.3.4/angular.js:25915) at script(rjs/r-2.0.1.js:2110) at script(rjs/r-2.0.1.js:1714) at script(rjs/r-2.0.1.js:1042) at script(rjs/r-2.0.1.js:1028) at script(rjs/r-2.0.1.js:224) at script(rjs/r-2.0.1.js:1725) at script(rjs/r-2.0.1.js:1085) at script(rjs/r-2.0.1.js:1279) at script(rjs/r-2.0.1.js:982) at script(rjs/r-2.0.1.js:1530) at script(rjs/r-2.0.1.js:256) at script(rjs/r-2.0.1.js:1027) at script(rjs/r-2.0.1.js:1064) at script(rjs/r-2.0.1.js:1279) at script(rjs/r-2.0.1.js:1568) at script(rjs/r-2.0.1.js:1266) at script(rjs/r-2.0.1.js:224) at script.each(rjs/r-2.0.1.js:161) at script(rjs/r-2.0.1.js:1259) at script(rjs/r-2.0.1.js:982) at script.callGetModule(rjs/r-2.0.1.js:1304) at script(rjs/r-2.0.1.js:1601) at script(rjs/r-2.0.1.js:2113) at script(rjs/r-2.0.1.js:1714) at script(rjs/r-2.0.1.js:1042) at script(rjs/r-2.0.1.js:1032) at script(rjs/r-2.0.1.js:1064) at script(rjs/r-2.0.1.js:1279) at script(rjs/r-2.0.1.js:1568) at script(rjs/r-2.0.1.js:1266) at script(rjs/r-2.0.1.js:224) at script.each(rjs/r-2.0.1.js:161) at script(rjs/r-2.0.1.js:1259) at script(rjs/r-2.0.1.js:982) at script(rjs/r-2.0.1.js:1530) at script(rjs/r-2.0.1.js:1809) at script(Loading /data/desarrollo/sources/svn/wr/attic/poc-sbt-jasmine/src/test/webapp/static/js/specs/contracts/models/organizationModel.spec.js)

This error can be avoided using the guidelines described in https://groups.google.com/forum/#!msg/angular/vm_LKsgjal8/QTXhrQcQdpUJ . Basically consists of slightly modifying the angular.js file, but I'd prefer not relying on that kind of modification.

I've tested that Karma + Jasmine 2.04 + AngularJS > 1.2.20 + RequireJS works, so the problem seems to be sbt-jasmine.

I'd be grateful if anyone can help me.

Thanks in advance.

theefer commented 9 years ago

As mentioned in the README, this plugin is no longer maintained. We recommend using https://github.com/guardian/sbt-grunt-plugin instead or other alternatives (e.g. SbtWeb, etc).