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

[BUGFIX beta] Fix broken unregisterWaiter semantics #10276

Merged
merged 1 commit into from
Jan 24, 2015

Conversation

ef4
Copy link
Contributor

@ef4 ef4 commented Jan 24, 2015

Ember.Test.unregisterWaiter is supposed to unregister only the waiter that matches the arguments you pass it. Due to a bug it actually unregisters all waiters with the same context.


App.testHelpers.wait().then(function() {
equal(obj.ready(), true, 'should not resolve until our waiter is ready');
Test.unregisterWaiter(obj, obj.ready);
equal(Test.waiters.length, 0, 'should not leave a waiter registered');
equal(Test.waiters.length, 1, 'should not leave the waiter registered');
App.testHelpers.wait().then(function() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This nesting seems odd. Can you return wait() here, and then chain the past assertion off the outside promise (instead of nesting another level)?

Ember.Test.unregisterWaiter is supposed to unregister only the waiter
that matches the arguments you pass it. Due to a bug it actually
unregisters all waiters with the same context.
@ef4 ef4 force-pushed the fix-unregister-waiter branch from a63af03 to cefb054 Compare January 24, 2015 04:05
@rwjblue
Copy link
Member

rwjblue commented Jan 24, 2015

👍 - LGTM

rwjblue added a commit that referenced this pull request Jan 24, 2015
[BUGFIX beta] Fix broken unregisterWaiter semantics
@rwjblue rwjblue merged commit d2d1490 into emberjs:master Jan 24, 2015
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.

2 participants