twitter flight - Jasmine test event with asynchronous call -


Issue handlers have to test with asynchronous internal methods, which are implemented by the SDK like Facebook.

The plain test is:

  Description ('some listen', function) (this (and 'anthreatage trigger', function) {var eventSpy = spyOnEvent (document, Run (function () {hope (eventSpy) .toHaveBeenTriggeredOn (document); var data = {param1: 'param1', param2: 'param2',} this.component.trigger ('somevent', data); run ;});});});   

When some event begins with the option, the component handler is removed:

  this.handler = function (e, data) { SDK.apicall (data, function (mistake, response) {if (mistake!) {DoSomething ();} // trigger data event J. string (document, 'annotherrets');}); }; }; Jasmin 1.3 and earlier, a  run  without a    

previous waits still executes instantly it actually waits for this is what makes asynchronous space.

Alternatively, if you really do not want to make external API calls during your tests, you can use some kind (). This will allow you to return the AJAX call immediately in the examination which has the advantage of making your specs fast, on whatever reaction you want to test (there is no waiting for API), and your glasses when running the API Less depend on.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -