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() { value++; return flag; }, "The Value should be incremented", 750);
runs(function() { expect(value).toBeGreaterThan(0); });
});
});`