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

html - Cut text on left side inside button while centering -

plugins - CodeIgniter support on netbeans 8.0 -

php - Selecting items from MySQL for a status update feed efficiently while accounting for possible spam -