#No provider for HttpRequestInterceptor with TestBed.get() even though I am providing it

1 messages · Page 1 of 1 (latest)

green imp
#

I am trying to unit test this interceptor. Specifically, I need to assert the logic for when it throws an exception with a message. However, the unit test is giving me a No provider for HttpRequestInterceptor! when I use interceptor = TestBed.get(HttpRequestInterceptor); . Any ideas what is wrong, please?

https://dpaste.org/Gq92U#L77

pulsar ibex
#

It's not provided as HttpRequestInterceptor

#

Which is expected.

#

It's provided as HTTP_INTERCEPTORS

green imp
#

oh wow, thanks. I tried that earlier and it did not work... I must of mispelled it