unit testing - How to write jasmine test to check update -
i'm trying write jasmine test check view changing time or not
it 'ticks time', -> @time = parseint($('#timer h1').text()) settimeout (-> @after = parseint($('#timer h1').text()) expect(@time).tobelessthan(@after) ), 1000
the problem when time of settimeout
jasmine
finished job, no html code on page related test @ moment.
jasmine has solutions kind of task:
it 'ticks time', -> runs -> @time = parseint($('#timer h1').text()) waits(1000) runs -> @after = parseint($('#timer h1').text()) expect(@time).tobegreaterthan(@after)
Comments
Post a Comment