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 - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -