Skip to content
Permalink
Browse files

Adds a unit test to control options are being copied by jQuery.Callba…

…cks internally.
  • Loading branch information
jaubourg committed Apr 25, 2012
1 parent ad32938 commit d17a7f04d45bc95e95eeeb97d87fb86aac5c2508
Showing with 18 additions and 0 deletions.
  1. +18 −0 test/unit/callbacks.js
@@ -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" );
});
});

0 comments on commit d17a7f0

Please sign in to comment.
You can’t perform that action at this time.