fix build error
This commit is contained in:
parent
196d2a3971
commit
fb089e7083
|
@ -29,32 +29,34 @@
|
||||||
<script src="qunit-2.5.0.js"></script>
|
<script src="qunit-2.5.0.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.externalScriptSequence = '';
|
var externalScriptSequence = '';
|
||||||
|
|
||||||
QUnit.module( 'Async Dependencies' );
|
|
||||||
|
|
||||||
var scriptCount = 0;
|
var scriptCount = 0;
|
||||||
|
|
||||||
|
QUnit.config.autostart = false;
|
||||||
|
QUnit.module( 'Async Dependencies' );
|
||||||
|
|
||||||
QUnit.test( 'Async scripts are loaded', function( assert ) {
|
QUnit.test( 'Async scripts are loaded', function( assert ) {
|
||||||
assert.expect( 5 );
|
assert.expect( 5 );
|
||||||
var done = assert.async( 5 );
|
var done = assert.async( 5 );
|
||||||
|
|
||||||
function callback( event ) {
|
function callback( event ) {
|
||||||
if( window.externalScriptSequence.length === 1 ) {
|
if( externalScriptSequence.length === 1 ) {
|
||||||
assert.ok( window.externalScriptSequence === 'A', 'first callback was sync script' );
|
assert.ok( externalScriptSequence === 'A', 'first callback was sync script' );
|
||||||
|
done();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
assert.ok( true, 'async script loaded' );
|
assert.ok( true, 'async script loaded' );
|
||||||
|
done();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( window.externalScriptSequence.length === 4 ) {
|
if( externalScriptSequence.length === 4 ) {
|
||||||
assert.ok( window.externalScriptSequence.indexOf( 'A' ) !== -1 &&
|
assert.ok( externalScriptSequence.indexOf( 'A' ) !== -1 &&
|
||||||
window.externalScriptSequence.indexOf( 'B' ) !== -1 &&
|
externalScriptSequence.indexOf( 'B' ) !== -1 &&
|
||||||
window.externalScriptSequence.indexOf( 'C' ) !== -1 &&
|
externalScriptSequence.indexOf( 'C' ) !== -1 &&
|
||||||
window.externalScriptSequence.indexOf( 'D' ) !== -1, 'four unique scripts were loaded' );
|
externalScriptSequence.indexOf( 'D' ) !== -1, 'four unique scripts were loaded' );
|
||||||
|
done();
|
||||||
}
|
}
|
||||||
|
|
||||||
done();
|
|
||||||
scriptCount ++;
|
scriptCount ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,6 +70,8 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QUnit.start();
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
Loading…
Reference in New Issue