MCPcopy
hub / github.com/angular/angular / runInterceptor

Function runInterceptor

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 3

runInInjectionContextMethod · 0.65
subscribeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…