Ability to create tests with nested modules
Change-Id: Ie0bf2dcfb63e7dc53cd5afe411e2fbb8d1bbfd73
This commit is contained in:
parent
0d7607db15
commit
0a208911a2
1 changed files with 18 additions and 5 deletions
|
|
@ -63,7 +63,12 @@
|
|||
( function () {
|
||||
var orgModule = QUnit.module;
|
||||
|
||||
QUnit.module = function ( name, localEnv ) {
|
||||
QUnit.module = function ( name, localEnv, executeNow ) {
|
||||
if ( arguments.length === 2 && typeof localEnv === 'function' ) {
|
||||
executeNow = localEnv;
|
||||
localEnv = undefined;
|
||||
}
|
||||
|
||||
localEnv = localEnv || {};
|
||||
orgModule( name, {
|
||||
setup: function () {
|
||||
|
|
@ -80,9 +85,11 @@
|
|||
localEnv.teardown.call( this );
|
||||
}
|
||||
|
||||
this.sandbox.verifyAndRestore();
|
||||
if ( this.sandbox ) {
|
||||
this.sandbox.verifyAndRestore();
|
||||
}
|
||||
}
|
||||
} );
|
||||
}, executeNow );
|
||||
};
|
||||
}() );
|
||||
|
||||
|
|
@ -90,8 +97,14 @@
|
|||
( function () {
|
||||
var orgModule = QUnit.module;
|
||||
|
||||
QUnit.module = function ( name, localEnv ) {
|
||||
QUnit.module = function ( name, localEnv, executeNow ) {
|
||||
var fixture;
|
||||
|
||||
if ( arguments.length === 2 && typeof localEnv === 'function' ) {
|
||||
executeNow = localEnv;
|
||||
localEnv = undefined;
|
||||
}
|
||||
|
||||
localEnv = localEnv || {};
|
||||
orgModule( name, {
|
||||
setup: function () {
|
||||
|
|
@ -110,7 +123,7 @@
|
|||
|
||||
fixture.parentNode.removeChild( fixture );
|
||||
}
|
||||
} );
|
||||
}, executeNow );
|
||||
};
|
||||
}() );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue