Here is the method in the service that I want to test
public loadConfigurations():Promise <any> {
return this.http.get(environment.BASE_URL).toPromise()
}
In the test.spec.ts
it('Should be return the enviroment configs from rest api',done =>{
service.loadConfigurations().then((data)=>{
console.log('data',data)
expect(data).toBe('test')
done();
}).catch((err)=>{
console.log(err);
})
})
I am getting the
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
When I run the tests without the above case, there is no timeout error so i belive something messed-up in my service
karma config
captureTimeout: 210000,
browserDisconnectTolerance: 3,
browserDisconnectTimeout: 210000,
browserNoActivityTimeout: 210000,