atecarlos / protractor-http-mock

A library designed to work alongside Protractor for setting up mocks for your HTTP ajax requests.
MIT License
173 stars 70 forks source link

interceptor.request calls twice for one interceptor #123

Closed Mishurin closed 7 years ago

Mishurin commented 7 years ago

Hi there,

I am not really familiar with a topic of how angular handles interceptors however maybe someone met a similar issue and may help. I have a couple of interceptors pushed into $httpProvider. One of them runs an application spinner which increments a counter of requests per each request and deducts the counter after response. What the protractor-http-mock plugin intends to do is to call interceptor.request per each interceptor it finds. But does that mean that spinner interceptor should trigger its request callback twice after overrides of the plugin?

Thank you!

atecarlos commented 7 years ago

Hi @Mishurin , just recently I published a new version of the package that includes some changes on how stateful interceptors should work. Please try it out. Hopefully that solves your problem.