jasmine.async
jasmine.async copied to clipboard
Preserve execution context
This change preserves the execution context in functions passed to async.beforeEach etc. so that the following code works:
describe("something", function () {
var async = new Async(this);
async.beforeEach(function (done) {
var self = this;
doSomethingAsync(function (asyncResult) {
self.result = asyncResult;
done();
});
});
it("is ready", function () {
expect(this.result).toBeDefined();
});
});