How to test a function which has a setTimeout with jasmine?
The overall approach varies based on your Jasmine version. Jasmine 1.3 You can use waitsFor: it( “Disable all submit buttons”, function() { // Get a button var $button = $( ‘#ai1ec_subscribe_users’ ); // Call the function utility_functions.block_all_submit_and_ajax( $button.get(0) ); // Wait 100ms for all elements to be disabled. waitsFor(‘button to be disabled’, function(){ var found … Read more