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

Function makeRequestAndExpectOne

packages/common/http/test/transfer_cache_spec.ts:487–496  ·  view source on GitHub ↗
(url: string, body: RequestBody, params?: RequestParams)

Source from the content-addressed store, hash-verified

485 params?: RequestParams & {observe: 'response'},
486 ): HttpResponse<string>;
487 function makeRequestAndExpectOne(url: string, body: RequestBody, params?: RequestParams): any {
488 let response!: any;
489 TestBed.inject(HttpClient)
490 .request(params?.method ?? 'GET', url, params)
491 .subscribe((r) => (response = r));
492 TestBed.inject(HttpTestingController)
493 .expectOne(url)
494 .flush(body, {headers: params?.responseHeaders ?? params?.headers});
495 return response;
496 }
497
498 function makeRequestAndExpectNone(
499 url: string,

Callers 1

Calls 5

expectOneMethod · 0.80
subscribeMethod · 0.65
injectMethod · 0.65
requestMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected