File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed
Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -165,8 +165,10 @@ module.exports = (grunt) ->
165165 specs : ' compiled_spec/*spec.js'
166166 helpers : ' spec/*helper.js'
167167 vendor : [
168- ' node_modules/jasmine- jquery/vendor/jquery /jquery.js'
168+ ' node_modules/jquery/dist /jquery.js'
169169 ' node_modules/jasmine-jquery/lib/jasmine-jquery.js'
170+ ' node_modules/sinon/pkg/sinon.js'
171+ ' node_modules/jasmine-sinon/lib/jasmine-sinon.js'
170172 ]
171173 template : require (' grunt-template-jasmine-istanbul' )
172174 templateOptions :
@@ -178,8 +180,10 @@ module.exports = (grunt) ->
178180 specs : ' compiled_spec/*spec.js'
179181 helpers : ' spec/*helper.js'
180182 vendor : [
181- ' node_modules/jasmine- jquery/vendor/jquery /jquery.js'
183+ ' node_modules/jquery/dist /jquery.js'
182184 ' node_modules/jasmine-jquery/lib/jasmine-jquery.js'
185+ ' node_modules/sinon/pkg/sinon.js'
186+ ' node_modules/jasmine-sinon/lib/jasmine-sinon.js'
183187 ]
184188 template : require (' grunt-template-jasmine-istanbul' )
185189 templateOptions :
Original file line number Diff line number Diff line change 3333 "grunt-contrib-watch" : " ^1.0.0" ,
3434 "grunt-template-jasmine-istanbul" : " ^0.5.0" ,
3535 "grunt-ts" : " ^5.5.1" ,
36+ "jquery" : " ^3.1.1" ,
3637 "jasmine-jquery" : " ^2.0.0" ,
38+ "sinon" : " ^1.17.6" ,
39+ "jasmine-sinon" : " ^0.4.0" ,
3740 "load-grunt-tasks" : " ^3.5.2"
3841 }
3942}
Original file line number Diff line number Diff line change 11' use strict'
2+
23describe ' CommentManager' , ->
34 manager = stage = cmt = c1 = c2 = c3 = c4 = c5 = null
45
@@ -66,15 +67,15 @@ describe 'CommentManager', ->
6667
6768 describe ' .start' , ->
6869 it ' starts the timer' , ->
70+ spy = sinon .spy window , ' setInterval'
6971 manager .start ()
70- # TODO: figure out how to test the timer
71- # maybe just add spy on window.setInterval
72+ expect (spy).toHaveBeenCalled true
7273
7374 describe ' .stop' , ->
7475 it ' stops the timer' , ->
76+ spy = sinon .spy window , ' clearInterval'
7577 manager .stop ()
76- # TODO: figure out how to test the timer
77- # maybe just add spy on window.clearInterval
78+ expect (spy).toHaveBeenCalled true
7879
7980 describe ' .clear' , ->
8081 it ' clears' , ->
You can’t perform that action at this time.
0 commit comments