Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

made jQueryify's callback send window,jQuery to the callback

  • Loading branch information...
commit 31a8b4d33f53de0e7ae33b5bf75a8ae6d20d3967 1 parent e212c18
@tmpvar authored
Showing with 7 additions and 8 deletions.
  1. +1 −1  lib/jsdom.js
  2. +6 −7 test/jsdom/index.js
View
2  lib/jsdom.js
@@ -39,7 +39,7 @@ exports.jQueryify = function (window /* path [optional], callback */) {
jQueryTag.onload = function() {
if (this.readyState === 'complete') {
if (callback) {
- callback();
+ callback(window, window.jQuery);
}
}
};
View
13 test/jsdom/index.js
@@ -6,14 +6,13 @@ exports.tests = {
assertNotNull("window must be a new object!", window);
},
- /*
- Async tests and mjsunit dont play well..
jquerify : function() {
- var window = jsdom.jQueryify("<html><head></head><body><p>it works</p></body></html>", false, false,
- function() {
- console.dir(window);
- assertEqual("jquery selectors should work at this point", window.jQuery("p").text(), "it works");
+ jsdom.jQueryify(jsdom.jsdom().createWindow(),
+ __dirname + "/../../example/jquery/jquery.js",
+ function(window, jQuery)
+ {
+ assertNotNull("jQuery should be attached to the window", jQuery.find);
});
- }*/
+ }
};

0 comments on commit 31a8b4d

Please sign in to comment.
Something went wrong with that request. Please try again.