Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix(ngMock): Add responseType function parameter in mock httpbackend for passthrough #11524

Closed

Conversation

prateek14
Copy link

The ngMock $httpBackend allows http request routes that have not been defined
for mocking to be passed through to the real http backend service. The
responseType parameter was missing in the ngMock httpbackend parameter
list.

closes #5415

@prateek14 prateek14 closed this Apr 7, 2015
@prateek14 prateek14 deleted the mockhttpbackend-responseType-fix branch April 7, 2015 01:13
@prateek14 prateek14 restored the mockhttpbackend-responseType-fix branch April 8, 2015 22:11
@prateek14 prateek14 reopened this Apr 8, 2015
@brphelps
Copy link

brphelps commented Apr 8, 2015

+1

passthrough

The ngMock $httpBackend allows http request routes that have not been defined
for mocking to be passed through to the real http backend service. The
responseType parameter was missing in the ngMock httpbackend parameter
list.

closes angular#5415
@prateek14 prateek14 force-pushed the mockhttpbackend-responseType-fix branch from ac15073 to aeaff8e Compare April 9, 2015 00:17
@RobertjanTuit
Copy link

+1

@petebacondarwin
Copy link
Contributor

This is not what ngMock $httpBackend was designed for - it is supposed to be for unit tests that should never touch a slow external service. Perhaps you wanted to use ngE2EMock instead?

@felixfbecker
Copy link

When I use ngMockE2E and specify to passThrough() a request for some binary file (lets say, a jpeg image) and then request it somewhere in my code with $http responseType: 'blob' the response.data property is always a string, not a blob. When I use it without ngMockE2E it works as expected. It seems like ngMockE2E is swallowing the responseType when passing through a request.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mock httpBackend does not support blobs for passThrough.
6 participants