X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=blobdiff_plain;f=tests%2Fqunit%2Fdata%2Ftestrunner.js;h=f023ddde3cb11b788d26554cdf6e118a6c35febd;hb=7471e1db1b613d035f981f489f8683a177acff7e;hp=39baf1701398c0fca5b5dd453cec5860f9998013;hpb=9def51e9d63bf0031bb6ef94ee5ab8b8846bd1e4;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/qunit/data/testrunner.js b/tests/qunit/data/testrunner.js index 39baf17013..f023ddde3c 100644 --- a/tests/qunit/data/testrunner.js +++ b/tests/qunit/data/testrunner.js @@ -64,6 +64,12 @@ var orgModule = QUnit.module; QUnit.module = function ( name, localEnv, executeNow ) { + if ( QUnit.config.moduleStack.length ) { + // When inside a nested module, don't add our Sinon + // setup/teardown a second time. + return orgModule.apply( this, arguments ); + } + if ( arguments.length === 2 && typeof localEnv === 'function' ) { executeNow = localEnv; localEnv = undefined; @@ -85,9 +91,7 @@ localEnv.teardown.call( this ); } - if ( this.sandbox ) { - this.sandbox.verifyAndRestore(); - } + this.sandbox.verifyAndRestore(); } }, executeNow ); }; @@ -202,7 +206,6 @@ return { setup: function () { - // Greetings, mock environment! mw.config = new MwMap(); mw.config.set( freshConfigCopy( localEnv.config ) );