Skip to content

Tests: Switch from .then to .done to get synchronous operation #19906

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

Closed
wants to merge 1 commit into from

Conversation

dmethvin
Copy link
Contributor

This is the only failure I found in the test suite with jQuery 3.0 and it's easily fixed. 🍕

jQuery 3.0 uses Promise/A+ compliant .then method which is always async. The older .done and .fail methods are still sync. Ref: https://jquery.com/upgrade-guide/3.0/

It's not clear why these two tests use Deferred at all since they appear to be completely synchronous. The giveaway is that there is no QUnit assert.async() call in the test, which you would need if there was any async component.

jQuery 3.0 uses Promise/A+ compliant .then method which is always async. The
older .done and .fail methods are still sync.

Ref: https://jquery.com/upgrade-guide/3.0/
@cvrebert
Copy link
Collaborator

Indeed, there's no good reason for these tests to be using Deferreds. Pretty sure they were just copying the skeleton of the other nearby tests.
I've stripped out the Deferreds in these tests in #20180.
Thanks!

@cvrebert cvrebert closed this Jun 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants