mdasberg / ng-apimock

Node plugin that provides the ability to use scenario based api mocking: for local development for protractor testing
MIT License
99 stars 26 forks source link

Bugfix: handle a request after it is ended. #24

Closed baconcutter closed 7 years ago

baconcutter commented 7 years ago

I noticed an issue when trying ng-apimock with angular-cli (as described in ANGULAR_CLI.md): When a POST request with a body is done then the mocked response is returned before the request has been ended. This often causes issues in the Angular proxy, either by throwing an error "[HPM] Error occurred while trying to proxy request" or by responding with half of the mocked JSON response.

Waiting on the 'end' event of the HTTP-request fixed this issue.

wswebcreation commented 7 years ago

Nice catch!

mdasberg commented 7 years ago

just release v1.4.0 which contains this bugfix