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

Function runInterceptor

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 3

runInInjectionContextMethod · 0.65
subscribeMethod · 0.65

Tested by

no test coverage detected