April 2015
Intermediate to advanced
276 pages
5h 38m
English
With JavaScript, we can create a time-dependent program/code and execute it at a specified time or time intervals using the setTimeout() and setInterval() methods. In Jasmine, we can also handle time-dependent code (or time events) using Jasmine Clock. This can be installed with a call to jasmine.clock().install() in a spec or suite that needs to manipulate time. In this recipe, you will learn how to mock the JavaScript timeout functions using Jasmine Clock.
To understand this recipe, let's assume that you are developing a JavaScript application and you have to implement test code to handle JavaScript timeout functions (that are, setTimeout() and setInterval()).
"As a JavaScript developer, ...
Read now
Unlock full access