Skip to content

Commit

Permalink
[BUGFIX beta] Guard jQuery access in setupForTesting.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed Mar 24, 2017
1 parent ef6cb33 commit 88c5bab
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/ember-testing/lib/setup_for_testing.js
Expand Up @@ -35,11 +35,13 @@ export default function setupForTesting() {
setAdapter((typeof self.QUnit === 'undefined') ? new Adapter() : new QUnitAdapter());
}

jQuery(document).off('ajaxSend', incrementPendingRequests);
jQuery(document).off('ajaxComplete', decrementPendingRequests);
if (jQuery) {
jQuery(document).off('ajaxSend', incrementPendingRequests);
jQuery(document).off('ajaxComplete', decrementPendingRequests);

clearPendingRequests();
clearPendingRequests();

jQuery(document).on('ajaxSend', incrementPendingRequests);
jQuery(document).on('ajaxComplete', decrementPendingRequests);
jQuery(document).on('ajaxSend', incrementPendingRequests);
jQuery(document).on('ajaxComplete', decrementPendingRequests);
}
}

0 comments on commit 88c5bab

Please sign in to comment.