I'm using jasmine to do unit testing and sinon to mock an ajax call. However, this causes an infinite loop where my test case is called repeatedly. The ajax call is made synchronously. If I change the ajax call to be asynchronous, the infinite loop does not occur. Any help or pointers will be greatly appreciated!I'm using jasmine to do unit testing and sinon