Suppose we have this method in a service that return an Observable:
getSearchResults(request: LocationSearchRequest){
return this.http.get(this.getApiUrl(request))
.map(res => <LocationSearchResponse> res.json())
.catch(this.handleError);
}
How can I modify this code to return the mocked data ratehr then making an actual GET requesr?
import { MOCKEDDATA } from './mocked-data';
It's not a duplicate question. This has nothing to do with testing, jasmine and angualr2 testing api.