Personally I don't have experience with MockBackend. However you can try 
the new tool http://mockhub.io . with this tool you can create HTTP mocks 
using a intuitive online form.




On Friday, March 3, 2017 at 9:50:26 AM UTC+1, Martin Kuhn wrote:
>
> Hi,
>
> I would to like to mock http requests not only for test but also for usual 
> development. 
>
> So I tried MockBackend which has the problem that also http request for 
> images etc. are handled by MockBackend.
> This means a more flexible solution has to be used.
>
> Next approach was to extend the Http class and do the magic on my own. 
> This works fine execpt error handling.
>
> When I would like to return an error from my mocked http call I tried a 
> construct like this:
>
>
> ...
>
> let response = new Response(new ResponseOptions({ body: e, status: 
> errorStatusCode, type: ResponseType.Error }));
> response.ok = false;
> return Observable.of(response);
>
>
>
> But it seems this is recognized as successful response.
>
> Does anybody of you know a solution to this problem?
>
> TIA
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to