Skip to content

Commit

Permalink
issue chieffancypants#27: fixing tests, and bumping angular libs
Browse files Browse the repository at this point in the history
Added angular libs via bower so I don't have to do this again
  • Loading branch information
chieffancypants committed Jan 21, 2014
1 parent c20abde commit c578c17
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
test/coverage
bower_components
11 changes: 9 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
6 changes: 3 additions & 3 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
],
Expand Down
8 changes: 5 additions & 3 deletions test/loading-bar-interceptor.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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()
Expand Down

0 comments on commit c578c17

Please sign in to comment.