Skip to content

Tests: Shift all tests to use no globals #1577

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

Merged
merged 26 commits into from
Apr 18, 2016
Merged

Conversation

apsdehal
Copy link
Member

This PR shifts all the tests to use no global QUnit variables and methods.

@jzaefferer
Copy link
Member

For the Intern migration this looks good. For the full migration to the QUnit 2.0 API its still missing asyncTest(), which I've filed an issue for in the underlying tool: apsdehal/qunit-migrate#4

We still have a work-in-progress PR that changes all test defines (#1569) and one that changes a ton of tests for one widget (#1513). @arschmitz tells me that the changes here are all automated, so to avoid merge conflicts we should land the other two PRs first (should happen in the next two weeks), then apply the automatic changes once more to do the migration.

@jzaefferer
Copy link
Member

@apsdehal we've landed the button rewrite in master. And you've addressed the asyncTest() migration. Could you update this PR based on the current master branch? Thanks.

@apsdehal
Copy link
Member Author

Will do it ASAP.

@scottgonzalez
Copy link
Member

@apsdehal I see you pushed some updated a few days ago. Is this now ready for another review?

@apsdehal
Copy link
Member Author

apsdehal commented Apr 6, 2016

@scottgonzalez No, not yet. I will ping you whenever this is ready.

@apsdehal apsdehal force-pushed the no-globals branch 2 times, most recently from af0d9c4 to 47f2c1e Compare April 6, 2016 14:21
@apsdehal
Copy link
Member Author

apsdehal commented Apr 6, 2016

@scottgonzalez It is ready for a round of review. Only test failing is one in effects, which if I change to asyncTest back works smoothly.

@jzaefferer
Copy link
Member

The issue is in the ".hide() with step" test in effects/core.js, which passes start as a complete callback. Needs to be replaced.

@apsdehal
Copy link
Member Author

apsdehal commented Apr 6, 2016

@jzaefferer Issue has been fixed now and the build is passing.

@jzaefferer
Copy link
Member

I don't now why GitHub instantly marks by diff comment as outdated. So:

+QUnit.test( "animateClass calls step option", 1, function( assert ) {

Could you convert the expect argument to assert.expect calls as well?

@apsdehal
Copy link
Member Author

apsdehal commented Apr 6, 2016

@jzaefferer Fixed.

@jzaefferer
Copy link
Member

I guess those 2 instances were the only ones still in master, nice.

@apsdehal
Copy link
Member Author

apsdehal commented Apr 6, 2016

Yes, I ran a regex check on the whole repo. Those were the only two.

expect( 1 );
QUnit.test( "JSHint", function( assert ) {
var ready = assert.async();
require( [ "jshint" ], function() {
Copy link
Member

Choose a reason for hiding this comment

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

Convert indentation to tabs.

@scottgonzalez
Copy link
Member

Please add a commit at the end that removes all the QUnit globals from

"globals": {

@apsdehal
Copy link
Member Author

@scottgonzalez I have addressed your comments.

@jzaefferer
Copy link
Member

Testing against custom QUnit build (pre-2.0) based on qunitjs/qunit#976

tests/unit/all.html isn't working due to JamesMGreene/qunit-composite#9

At least tests/unit/dialog/dialog.html and tests/unit/effects/effects.html fail due to JamesMGreene/qunit-assert-close#4

There might be other failures, but its hard to tell with the many errors coming from qunit-assert-close.

@apsdehal would you be interested in patching qunit-composite, qunit-assert-close or both? That would help a lot.

@apsdehal
Copy link
Member Author

@jzaefferer Sure, will do it!

@jzaefferer
Copy link
Member

@scottgonzalez updating those externals shouldn't block this, after all the PR works just fine, and QUnit 2.0 isn't even released. Based on my testing with QUnit pre-2.0, the changes here work fine. Unless I'm missing something, we can merge this and release rc2. (I'm not sure why I thought that rc2 should wait).

@scottgonzalez
Copy link
Member

@jzaefferer I'm not sure what externals you're referring to. Did you mean the globals? @apsdehal already removed them from the JSHint config. I asked for that to be part of this PR to ensure that none of the globals were missed during the update.

@jzaefferer jzaefferer merged commit 2e77015 into jquery:master Apr 18, 2016
@jzaefferer
Copy link
Member

Thanks a lot @apsdehal!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants