+
+ // Check for incomplete animations/requests/etc and throw
+ // error if there are any.
+ if ( $.timers && $.timers.length !== 0 ) {
+ // Test may need to use fake timers, wait for animations or
+ // call $.fx.stop().
+ throw new Error( 'Unfinished animations: ' + $.timers.length );
+ }
+ if ( $.active !== undefined && $.active !== 0 ) {
+ // Test may need to use fake XHR, wait for requests or
+ // call abort().
+ throw new Error( 'Unfinished AJAX requests: ' + $.active );
+ }