Skip to content

Conversation

@mgrandrath
Copy link

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();
  });
});

This change preserves the execution context in functions passed to async.beforeEach etc. so that the following code works:

```javascript
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();
  });
});
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant