when i am trying to test a function which returns a promise i get the following error:
"Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
"
my spec is as follows:
describe('async promise test', function () {
beforeEach(module('app'));
beforeEach(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = 6 * 1000;
})
it('should match the name', function (done) {
inject(function ($rootScope,promiseTest) {
$rootScope.$apply(function(){
var promise =promiseTest.checkPromise();
promise.then(function(data){
console.log(data);
done();
})
})
})
})
});
please check the plunker link for the complete code plunker link