I'm trying to mock the Http class so I could inject it on a service that I want to test.
Usually, I create a mock class that extends the class that will be override. For this case, I did something like this:
export class MockHttp extends Http {
constructor(){super(undefined, undefined);}
get(url: string, options?: RequestOptionsArgs): Observable<Response> {
return new Observable((observer) => {
observer.next(undefined);
observer.complete();
});
}
}
But the intelisense of vs code give me the following error, on the method get:
Property 'get' in type 'MockAppHttpClientService' is not assignable to the same property in base type 'Http'.
Any one knows how to solve this?