14
14
factory ( QUnit ) ;
15
15
}
16
16
} ( function ( QUnit ) {
17
- var iframe , hasBound ,
17
+ var iframe , hasBound , resumeTests , suiteAssert ,
18
18
modules = 1 ,
19
19
executingComposite = false ;
20
20
@@ -48,7 +48,9 @@ function runSuite( suite ) {
48
48
path = suite ;
49
49
}
50
50
51
- QUnit . asyncTest ( suite , function ( ) {
51
+ QUnit . test ( suite , function ( assert ) {
52
+ resumeTests = assert . async ( ) ;
53
+ suiteAssert = assert ;
52
54
iframe . setAttribute ( "src" , path ) ;
53
55
// QUnit.start is called from the child iframe's QUnit.done hook.
54
56
} ) ;
@@ -90,13 +92,13 @@ function initIframe() {
90
92
}
91
93
// Pass all test details through to the main page
92
94
var message = ( moduleName ? moduleName + ": " : "" ) + testName + ": " + ( data . message || ( data . result ? "okay" : "failed" ) ) ;
93
- expect ( ++ count ) ;
94
- QUnit . push ( data . result , data . actual , data . expected , message ) ;
95
+ suiteAssert . expect ( ++ count ) ;
96
+ suiteAssert . push ( data . result , data . actual , data . expected , message ) ;
95
97
} ) ;
96
98
97
99
// Continue the outer test when the iframe's test is done
98
100
iframeWin . QUnit . done ( function ( ) {
99
- QUnit . start ( ) ;
101
+ resumeTests ( ) ;
100
102
} ) ;
101
103
}
102
104
@@ -177,7 +179,7 @@ QUnit.testSuites = function( name, suites ) {
177
179
}
178
180
179
181
QUnit . module ( name , {
180
- setup : function ( ) {
182
+ beforeEach : function ( ) {
181
183
executingComposite = true ;
182
184
}
183
185
} ) ;
@@ -193,16 +195,8 @@ QUnit.testDone(function( data ) {
193
195
}
194
196
195
197
var i , len ,
196
- testId = data . testId || QUnit . config . current . testId || data . testNumber || QUnit . config . current . testNumber ,
197
- current = testId ?
198
- (
199
- // QUnit @^1.16.0
200
- document . getElementById ( "qunit-test-output-" + testId ) ||
201
- // QUnit @1.15.x
202
- document . getElementById ( "qunit-test-output" + testId )
203
- ) :
204
- // QUnit @<1.15.0
205
- document . getElementById ( QUnit . config . current . id ) ,
198
+ testId = data . testId ,
199
+ current = document . getElementById ( "qunit-test-output-" + testId ) ,
206
200
children = current && current . children ,
207
201
src = iframe . src ;
208
202
@@ -231,4 +225,4 @@ QUnit.testDone(function( data ) {
231
225
current . getElementsByTagName ( "a" ) [ 0 ] . href = src ;
232
226
} ) ;
233
227
234
- } ) ) ;
228
+ } ) ) ;
0 commit comments