I have some Jasmine tests for my (currently) very simple site consisting of a Rails back end and an AngularJS front end. I’m trying to do some Jasmine end-to-end testing, but including angular-scenario.js makes my tests not run. It doesn’t make them fail. It makes them not start at all.
I’m using version 1.0.7, and all the Angular files are from the same version (and all from the official Angular site. The version of Rails I’m using is 3.1.3 with Ruby 1.9.3. I’m also using the jasmine gem version 1.3.2 and jasmine-rails 0.4.5.
#= require angular.min #= require angular-mocks
describe 'test', () -> it 'works', () -> expect(true).toEqual(true)
Of course, that’s just a placeholder until I can get the test work correctly with angular-scenario.js in place.
Without angular-scenario.js, the tests run. With it, nothing.
The output without angular-secnario.js:
Starting... Finished ----------------- 1 spec, 0 failures in 0.005s. ConsoleReporter finished
The output with angular-scenario.js:
Starting... Finished ----------------- 0 specs, 0 failures in 0s. ConsoleReporter finished
Things I’ve tried:
- Moving angular-scenario.js to vendor/assets/javacripts and requiring it from spec_helper.coffee.
- Removing either other Angular-related requirement from spec_helper.coffee.
- angular-scenario.js comes with jQuery packaged with it. Commenting out the jQuery bit, oddly enough, makes the tests run, though they fail because angular-scenario needs jQuery, apparently. I also tried commenting out the jQuery in angular-scenario and including jQuery from the jquery-rails gem. (That was a shot in the dark. I didn’t think that would actually work.)
Thank you very much to whoever wants to take a swing at this one.
Jasmine and angular-scenario.js (e2e runner) are two different things and they should be run separately. Angular e2e test framework uses syntax which is very similar to jasmine. Probably when you include it along with jasmine it overrides some jasmine’s methods like
Answered By – luacassus
Answer Checked By – Pedro (AngularFixing Volunteer)