MCPcopy Create free account
hub / github.com/angular/angular / runInterceptor

Function runInterceptor

packages/common/http/test/transfer_cache_spec.ts:113–126  ·  view source on GitHub ↗
(
      req: HttpRequest<unknown>,
      next: (req: HttpRequest<unknown>) => Observable<HttpResponse<unknown>>,
    )

Source from the content-addressed store, hash-verified

111 }
112
113 function runInterceptor(
114 req: HttpRequest<unknown>,
115 next: (req: HttpRequest<unknown>) => Observable<HttpResponse<unknown>>,
116 ): HttpResponse<unknown> {
117 let response!: HttpResponse<unknown>;
118 TestBed.runInInjectionContext(() => {
119 transferCacheInterceptorFn(req, next).subscribe((event) => {
120 if (event instanceof HttpResponse) {
121 response = event;
122 }
123 });
124 });
125 return response;
126 }
127
128 it('should not reuse cached responses for Cookie-bearing requests by default', () => {
129 configureInterceptor();

Callers 1

Calls 3

runInInjectionContextMethod · 0.65
subscribeMethod · 0.65

Tested by

no test coverage detected