Jasmine has Asynchronous Support which uses "function + done" formular. This spec will not start until the done function is called in the call to beforeEach. And this spec will not complete until its done is called.
beforeEach(function(done) {
setTimeout(function() {
value = 0;
done();
}, 1);