Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose isSettled utility function. #248

Merged
merged 1 commit into from
Nov 30, 2017

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Nov 30, 2017

This is a simple refactoring of the existing settled helper that exposes an isSettled() function which can be used generally to confirm that there are is no pending async.

One example use case is for ember-qunit (and also ember-mocha) to implement something like:

import { isSettled } from '@ember/test-helpers';

QUnit.testDone(function(results) {
  if (!isSettled) {
    throw new Error(`${results.name} leaks async`);
  }
});

This is a simple refactoring of the existing `settled` helper that
exposes an `isSettled()` function which can be used generally to confirm
that there are is no pending async.

One example use case is for `ember-qunit` (and also `ember-mocha`) to
implement something like:

```js
import { isSettled } from '@ember/test-helpers';

QUnit.testDone(function(results) {
  if (!isSettled) {
    throw new Error(`${results.name} leaks async`);
  }
});
```
@rwjblue
Copy link
Member Author

rwjblue commented Nov 30, 2017

😩 ember-beta is failing now due to emberjs/ember.js#15831 😭

@rwjblue rwjblue merged commit ca52448 into emberjs:master Nov 30, 2017
@rwjblue rwjblue deleted the expose-is-settled branch November 30, 2017 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants