Skip to content

Commit 8c7853c

Browse files
committed
update all dev dependencies
updated all dev dependencies to current added jasmine-core to satisfy peer dependencies updated syntax in unit tests due to breaking changes in jasmine 2.x syntax
1 parent 73ff0d9 commit 8c7853c

File tree

3 files changed

+44
-36
lines changed

3 files changed

+44
-36
lines changed

package.json

+12-11
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,17 @@
3131
},
3232
"homepage": "https://chieffancypants.github.io/angular-loading-bar",
3333
"devDependencies": {
34-
"karma-jasmine": "^0.1.3",
35-
"karma-coffee-preprocessor": "^0.2.0",
36-
"karma-phantomjs-launcher": "^0.1.0",
37-
"karma": "~0.12.0",
38-
"karma-coverage": "^0.1.0",
39-
"grunt": "~0.4.1",
40-
"grunt-contrib-jshint": "~0.6.4",
41-
"grunt-contrib-uglify": "^0.9.1",
42-
"grunt-contrib-cssmin": "~0.12.0",
43-
"grunt-karma": "~0.11.0",
44-
"grunt-contrib-concat": "^0.5.0"
34+
"grunt": "^1.0.1",
35+
"grunt-contrib-concat": "^1.0.1",
36+
"grunt-contrib-cssmin": "^2.2.0",
37+
"grunt-contrib-jshint": "^1.1.0",
38+
"grunt-contrib-uglify": "^3.0.0",
39+
"grunt-karma": "^2.0.0",
40+
"jasmine-core": "^2.6.2",
41+
"karma": "^1.7.0",
42+
"karma-coffee-preprocessor": "^1.0.1",
43+
"karma-coverage": "^1.1.1",
44+
"karma-jasmine": "^1.1.0",
45+
"karma-phantomjs-launcher": "^1.0.4"
4546
}
4647
}

test/loading-bar-interceptor-config.coffee

+17-18
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,27 @@ describe 'loadingBarInterceptor Service - config options', ->
4444
cfpLoadingBar.complete()
4545
$timeout.flush()
4646

47-
it 'should not auto increment loadingBar if configured', (done) ->
48-
module 'chieffancypants.loadingBar', (cfpLoadingBarProvider) ->
49-
cfpLoadingBarProvider.autoIncrement = false
50-
return
51-
inject ($timeout, cfpLoadingBar) ->
52-
flag = false
53-
cfpLoadingBar.start()
54-
cfpLoadingBar.set(.5)
55-
runs ->
47+
describe 'loadingBarInterceptor Service - config options, async tests', ->
48+
beforeEach (done) ->
49+
module 'chieffancypants.loadingBar', (cfpLoadingBarProvider) ->
50+
cfpLoadingBarProvider.autoIncrement = false
51+
return
52+
inject ($timeout, cfpLoadingBar) ->
53+
cfpLoadingBar.start()
54+
cfpLoadingBar.set(.5)
5655
setTimeout ->
57-
flag = true
56+
done()
5857
, 500
5958

60-
waitsFor ->
61-
return flag
62-
, "500ms timeout"
63-
, 1000
59+
it 'should not auto increment loadingBar if configured', (done) ->
60+
inject ($timeout, cfpLoadingBar) ->
61+
setTimeout ->
62+
expect(cfpLoadingBar.status()).toBe .5;
63+
cfpLoadingBar.complete();
64+
$timeout.flush();
65+
done();
66+
, 500
6467

65-
runs ->
66-
expect(cfpLoadingBar.status()).toBe .5;
67-
cfpLoadingBar.complete()
68-
$timeout.flush()
6968

7069
it 'should auto increment loadingBar if configured', ->
7170
module 'chieffancypants.loadingBar', (cfpLoadingBarProvider) ->

test/loading-bar-interceptor.coffee

+15-7
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,21 @@ describe 'loadingBarInterceptor Service', ->
3434
$animate.triggerCallbacks && $animate.triggerCallbacks()
3535

3636
beforeEach ->
37-
this.addMatchers
38-
toBeBetween: (high, low) ->
39-
if low > high
40-
temp = low
41-
low = high
42-
high = temp
43-
return this.actual > low && this.actual < high
37+
jasmine.addMatchers
38+
toBeBetween: () ->
39+
return compare: (actual, high, low) ->
40+
if low > high
41+
temp = low
42+
low = high
43+
high = temp
44+
passed = actual > low && actual < high
45+
result =
46+
pass:
47+
passed
48+
message:
49+
'expected ' + actual + ' to ' + (if passed then 'not ' else '') + 'be between ' + low + ' and ' + high
50+
return result
51+
4452

4553

4654
afterEach ->

0 commit comments

Comments
 (0)