I am looking for a terse example of how to test a Deferred with Jasmine. I basically want to validate the done result. A clear example would be appreciated.
>> Neighborhood.js <<
Neighborhood = function(){
var me = {};
me.updates = function(){
var def = $.Deferred();
setTimeout(def.resolve([{"aaa",200},{"bbb",300}]), 1000*5);
return def.promise();
};
return me;
}
>> App.js <<
$(function(){
var neighborhood = Neighborhood();
neighorhood.updates().done(function(data){ console.log(data) });
})
I reviewed all the asynchronous examples, but I still don't have a clear understanding of how to test the result of a deferred in a terse manner.
Thanks in advance for an example,
Jaye Speaks
@jspeaks
--
You received this message because you are subscribed to the Google Groups "Jasmine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jasmine-js/-/v9PZHXyBAJoJ.
To post to this group, send email to jasmi...@googlegroups.com.
To unsubscribe from this group, send email to jasmine-js+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jasmine-js?hl=en.