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

Make tests pass with Zepto #2432

Closed
wants to merge 3 commits into from

Conversation

wookiehangover
Copy link
Collaborator

After doing a little bit more digging for #2431, I was able to get the test suite to pass with the latest version of Zepto.

Zepto does not support triggering events for elements that aren't in the DOM. I changed the few instances in the test suite where we were triggering events on views that aren't in the DOM to add themselves to #qunit-fixtures and voila, the test suite passes in Zepto.

I went ahead and added the Zepto tests to the travis build, too.

Seeing that we still recommend that it's a valid jQuery replacement, I think that we should keep the tests for it or either alter the docs to say explicitly that we don't support it.

@braddunbar
Copy link
Collaborator

Looks like it failed the build by introducing a _zid global. I assume that's a Zepto variable since I don't recognize it from Backbone.

@wookiehangover
Copy link
Collaborator Author

@braddunbar so I removed the noglobals option from the zepto runner. Is that an acceptable workaround? If not, I honestly don't really care if Travis runs the Zepto tests...

@braddunbar
Copy link
Collaborator

Either way is fine with me, I just wanted to make sure you knew. :)

@jashkenas
Copy link
Owner

So -- the real reason I removed the Zepto tests wasn't because they didn't happen to pass ... it was because they hadn't passed for a long time. We don't habitually test against Zepto, and we never really have. Nonetheless, I've never (extremely rarely?) seen tickets for improving Zepto support. This could suggest a couple of things:

  • Hardly anyone uses Zepto+Backbone instead of jQuery+Backbone for real sites.
  • Things that are in the jQuery API but don't work in Zepto, aren't desired by Zepto users, so we don't have to worry about 100% compatibility.

Regardless, having the tests in there and never really looking at them is a false promise. Better just to leave 'em out, I think. Backbone can simply support Zepto to the extent that Zepto supports the core pieces of the jQuery API. We don't have to be pretending to test those core pieces for them. Make sense?

@jashkenas jashkenas closed this Mar 27, 2013
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.

3 participants