diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-04-18 22:36:15 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-04-18 22:36:15 -0400 |
commit | a28983086ee91b19200c47fadc6bc3ba58a0fcb9 (patch) | |
tree | 63cb0a513473836b603213f06a31611c6c453e82 /tests/unit/subsuiteRunner.js | |
parent | cb8474af1dc099de9e08665c9d6cdc2cf5864203 (diff) | |
download | jquery-ui-a28983086ee91b19200c47fadc6bc3ba58a0fcb9.tar.gz jquery-ui-a28983086ee91b19200c47fadc6bc3ba58a0fcb9.zip |
Tests: Lint.
Diffstat (limited to 'tests/unit/subsuiteRunner.js')
-rw-r--r-- | tests/unit/subsuiteRunner.js | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/tests/unit/subsuiteRunner.js b/tests/unit/subsuiteRunner.js index ddfccc7c1..2d6de2de1 100644 --- a/tests/unit/subsuiteRunner.js +++ b/tests/unit/subsuiteRunner.js @@ -4,13 +4,16 @@ var subsuiteFrame; QUnit.extend( QUnit, { testSuites: function( suites ) { + function generateSuite( suite ) { + asyncTest( suite, function() { + QUnit.runSuite( suite ); + }); + } + for ( var i = 0; i < suites.length; i++ ) { - (function( suite ) { - asyncTest( suite, function() { - QUnit.runSuite( suite ); - }); - }( suites[i] ) ); + generateSuite( suites[ i ] ); } + QUnit.done = function() { subsuiteFrame.style.display = "none"; }; @@ -23,10 +26,12 @@ QUnit.extend( QUnit, { testDone: function() { var current = QUnit.id( this.config.current.id ), - children = current.children; + children = current.children, + i = 0, + length = children.length; // undo the auto-expansion of failed tests - for ( var i = 0; i < children.length; i++ ) { + for ( ; i < length; i++ ) { if ( children[i].nodeName === "OL" ) { children[i].style.display = "none"; } @@ -34,10 +39,11 @@ QUnit.extend( QUnit, { }, runSuite: function( suite ) { - var body = document.getElementsByTagName( "body" )[0], - iframe = subsuiteFrame = document.createElement( "iframe" ), - iframeWin; + var iframeWin, + body = document.getElementsByTagName( "body" )[0], + iframe = document.createElement( "iframe" ); + subsuiteFrame = iframe; iframe.className = "qunit-subsuite"; body.appendChild( iframe ); |