Asynchronous support in Jasmine

Hi All,

I understand what is waitsfor and the second run is doing waitsfor blocks the execution of the second run until the condition in it is met or times out happens but what about the first runs ? what is the purpose of it ?

describe(“Asynchronous specs”, function() {
var value, flag;

it(“should support async execution of test preparation and expectations”, function() {

runs(function() {
  flag = false;
  value = 0;
  setTimeout(function() {
    flag = true;
  }, 500);
waitsFor(function() {
  return flag;
}, "The Value should be incremented", 750);
runs(function() {


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.