"Can't find variable: angular" When tested as a dependency
Closed this issue · 0 comments
SimonMo88 commented
What version of angular-loading-bar are you using?
0.9.0
What version of AngularJS are you using?
v1.5.5
What browsers are affected?
PhantomJS
Please provide either a JSFiddle, Plunkr example that replicates the issue
Please describe the issue
When running a test where angular-loading-bar is a dependency of another angular module using Karma and PhantomJS an error occurs
What did you expect to happen?
Expected no errors and test to be executed
What actually happened?
When running a test an error "Can't find variable: angular" is displayed then subsequent tests are not executed
Passing window.angular through the self invoking function resolves this.
Example below
Before
(function(){
...
}()
After
(function(angular){
...
}(window.angular)