(interceptor: HttpInterceptorFn)
| 59 | for (const kind of ['functional', 'legacy']) { |
| 60 | describe(`${kind} interceptor stability`, () => { |
| 61 | function configureInterceptor(interceptor: HttpInterceptorFn): void { |
| 62 | TestBed.configureTestingModule({ |
| 63 | providers: |
| 64 | kind === 'functional' |
| 65 | ? [provideHttpClient(withInterceptors([interceptor]))] |
| 66 | : [ |
| 67 | provideHttpClient(withInterceptorsFromDi()), |
| 68 | { |
| 69 | provide: HTTP_INTERCEPTORS, |
| 70 | multi: true, |
| 71 | useValue: { |
| 72 | intercept: (req: HttpRequest<unknown>, next: HttpHandler) => |
| 73 | interceptor(req, (request) => next.handle(request)), |
| 74 | }, |
| 75 | }, |
| 76 | ], |
| 77 | }); |
| 78 | } |
| 79 | |
| 80 | it('should become stable after a synchronous interceptor error', async () => { |
| 81 | const error = new Error('interceptor failed'); |
no test coverage detected