-( function ( mw ) {
+( function () {
QUnit.module( 'mediawiki.requestIdleCallback', QUnit.newMwEnvironment( {
setup: function () {
var clock = this.clock = this.sandbox.useFakeTimers();
if ( window.requestIdleCallback ) {
QUnit.test( 'native', function ( assert ) {
var done = assert.async();
- // Remove polyfill
+ // Remove polyfill and clock stub
mw.requestIdleCallback.restore();
+ this.clock.restore();
mw.requestIdleCallback( function () {
assert.expect( 0 );
done();
} );
}
-}( mediaWiki ) );
+}() );