diff --git a/.gitignore b/.gitignore index c0ddb99..27a2a31 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules test/coverage +bower_components diff --git a/bower.json b/bower.json index 5e7601a..849a36a 100644 --- a/bower.json +++ b/bower.json @@ -1,12 +1,19 @@ { "name": "angular-loading-bar", "version": "0.1.1", - "main": ["src/loading-bar.js", "src/loading-bar.css"], + "main": [ + "src/loading-bar.js", + "src/loading-bar.css" + ], "ignore": [ "**/.*", "node_modules", "components", "test", "example" - ] + ], + "devDependencies": { + "angular-mocks": "~1.2.9", + "angular-animate": "~1.2.9" + } } diff --git a/test/karma.conf.js b/test/karma.conf.js index b162849..7a6048f 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -14,9 +14,9 @@ module.exports = function(config) { // list of files / patterns to load in the browser files: [ - 'lib/angular.min.js', - 'lib/angular-animate.min.js', - 'lib/angular-mocks.js', + '../bower_components/angular/angular.js', + '../bower_components/angular-animate/angular-animate.js', + '../bower_components/angular-mocks/angular-mocks.js', '../src/*.js', '*.coffee' ], diff --git a/test/loading-bar-interceptor.coffee b/test/loading-bar-interceptor.coffee index 035afd2..7f1f58c 100644 --- a/test/loading-bar-interceptor.coffee +++ b/test/loading-bar-interceptor.coffee @@ -157,10 +157,10 @@ describe 'loadingBarInterceptor Service', -> $http.get(endpoint) $httpBackend.flush(1) + $timeout.flush() # flush the latencyThreshold timeout - injected = isLoadingBarInjected $document.find(cfpLoadingBar.parentSelector) + expect(isLoadingBarInjected($document.find(cfpLoadingBar.parentSelector))).toBe true - expect(injected).toBe true $httpBackend.flush() $timeout.flush() @@ -171,7 +171,9 @@ describe 'loadingBarInterceptor Service', -> $http.get(endpoint) $http.get(endpoint) - $timeout.flush() # loading bar is animated, so flush timeout + $httpBackend.flush(1) + $timeout.flush() # flush the latencyThreshold timeout + expect(isLoadingBarInjected($document.find(cfpLoadingBar.parentSelector))).toBe true $httpBackend.flush()