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

Function trackEvents

packages/common/http/test/fetch_spec.ts:28–39  ·  view source on GitHub ↗
(obs: Observable<any>)

Source from the content-addressed store, hash-verified

26import {FetchBackend, FetchFactory, HTTP_FETCH_MAX_RESPONSE_SIZE} from '../src/fetch';
27
28function trackEvents(obs: Observable<any>): Promise<any[]> {
29 return obs
30 .pipe(
31 // We don't want the promise to fail on HttpErrorResponse
32 catchError((e) => of(e)),
33 scan((acc, event) => {
34 acc.push(event);
35 return acc;
36 }, [] as any[]),
37 )
38 .toPromise() as Promise<any[]>;
39}
40
41const TEST_POST = new HttpRequest('POST', '/test', 'some body', {
42 responseType: 'text',

Callers 1

fetch_spec.tsFile · 0.70

Calls 3

catchErrorFunction · 0.85
scanFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected