I am fetching the data using the backbone fetch call. When I tried to test it using the jasmine, I got an error as Error: Timeout - Async callback was not invoked within the timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
When I console the valueReturned it provides me the actual value which I need. There is no error in the response. But the only thing which I get on my page is timeout error which I specified above.
Can you please let me know what I am doing wrong?
describe("fetch call", function() {
var valueReturned;
beforeEach(function(done) {
window.jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
setTimeout(function () {
todoCollectionCursor.fetch({
success : function(collection, response, options) {
valueReturned = options.xhr.responseText;
return valueReturned;
}
});
},500);
});
it("should return string", function(done) {
console.log(valueReturned);
expect(typeof valueReturned).toEqual('string');
});
});