I am trying to upgrade my Angular application from 1.3.x to 1.5.1. I have a set of tests that all worked perfectly with Karma + PhantomJS when I was in version 1.3.x of Angular, however, after I updated all my tests, you failed. It seems that the way I introduced modules into unit tests no longer works.
This does not work in 1.5:
'use strict'
App = null
fdescribe 'App Model', ->
beforeEach module('MyAngularApp')
beforeEach inject ($injector)->
App = $injector.get('App')
it 'should exist', ->
console.log 'App:', App
expect(App).toBeDefined()
I also tried to inject the following
beforeEach inject ($injector, _App_)->
App = _App_
but my application model is still not being introduced.
I was looking at the documentation on AngularJS 1.5.1, but I did not see any changes that I need to make with the injector.
In Angular 1.5.x, how can I correctly insert a model into my unit tests?
source
share