New to Jasmine, I am testing one async function. Its showing a error saying Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. Please help if I am missing something here.
Function to test :
function AdressBook(){
this.contacts = [];
this.initialComplete = false;
}
AdressBook.prototype.initialContact = function(name){
var self = this;
fetch('ex.json').then(function(){
self.initialComplete = true;
console.log('do something');
});
}
Testing specs are as below :
var addressBook = new AdressBook();
beforeEach(function(done){
addressBook.initialContact(function(){
done();
});
});
it('should get the init contacts',function(done){
expect(addressBook.initialComplete).toBe(true);
done();
});