Adds a unit test to control options are being copied by jQuery.Callbacks internally.

This commit is contained in:
jaubourg 2012-04-25 02:13:26 +02:00
parent ad329384ff
commit d17a7f04d4

View File

@ -203,3 +203,21 @@ jQuery.each( tests, function( strFlags, resultString ) {
});
})();
test( "jQuery.Callbacks( options ) - options are copied", function() {
expect( 1 );
var options = {
memory: true
},
cb = jQuery.Callbacks( options );
options.memory = false;
cb.fire( "hello" );
cb.add(function( hello ) {
strictEqual( hello, "hello", "options are copied internally" );
});
});