Intercept not working properly #27251
-
I'm trying to test my Angular app in the component-testing-mode. So here are the details: The Interceptors look like this: The Post-Interceptor works like a charm and always returns the returnValue. Anybody got an idea, what the problem could be? I'm desperate. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
If anyone has the same error and is desperate as I was, I had a stupid error. so instead of |
Beta Was this translation helpful? Give feedback.
-
Thank you for the hint. But there is still a problem when an app actually fetches url without slash (e.g. Here the issue: #31215 |
Beta Was this translation helpful? Give feedback.
If anyone has the same error and is desperate as I was, I had a stupid error.
My URL started without a slash.
The requests were send to the cypress-own-backend.
So the post-Request was mocked, because there was no post in the cypress-backend, but the get-Request wasn't mocked, because cypress tried to get something from this backend.
so instead of
const url = 'this/is/my/url'
I just needed to writeconst url = '/this/is/my/url'