Merge "HTMLSelectAndOtherField/HTMLSelectOrOtherField: Add OOUI implementation"
[lhc/web/wiklou.git] / tests / qunit / data / testrunner.js
index d7da5a0..f023ddd 100644 (file)
                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 );
                };