mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Ajax: add unit test for getScript(Object)
Fixes gh-3736 Close gh-3918
This commit is contained in:
parent
80f57f8a13
commit
7be448d41f
@ -2281,6 +2281,24 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit.test( "jQuery.getScript( Object ) - with callback", 2, function( assert ) {
|
||||
var done = assert.async();
|
||||
|
||||
Globals.register( "testBar" );
|
||||
jQuery.getScript( {
|
||||
url: url( "mock.php?action=testbar" ),
|
||||
success: function() {
|
||||
assert.strictEqual( window[ "testBar" ], "bar", "Check if script was evaluated" );
|
||||
done();
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit.test( "jQuery.getScript( Object ) - no callback", 1, function( assert ) {
|
||||
Globals.register( "testBar" );
|
||||
jQuery.getScript( { url: url( "mock.php?action=testbar" ) } ).done( assert.async() );
|
||||
} );
|
||||
|
||||
// //----------- jQuery.fn.load()
|
||||
|
||||
// check if load can be called with only url
|
||||
|
Loading…
Reference in New Issue
Block a user