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

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -