Edit in JSFiddle

// Code under test
var flag = false;

function testAsync(done) {
    // Wait two seconds, then set the flag to true
    setTimeout(function () {
        flag = true;

        // Invoke the special done callback
        done();
    }, 2000);
}

// Specs
describe("Testing async calls with beforeEach and passing the special done callback around", function () {

    beforeEach(function (done) {
        // Make an async call, passing the special done callback        
        testAsync(done);
    });

    it("Should be true if the async call has completed", function () {
        expect(flag).toEqual(true);
    });

});