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

Function makeRequestAndExpectOne

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

Source from the content-addressed store, hash-verified

431 params?: RequestParams & {observe: 'response'},
432 ): HttpResponse<string>;
433 function makeRequestAndExpectOne(url: string, body: RequestBody, params?: RequestParams): any {
434 let response!: any;
435 TestBed.inject(HttpClient)
436 .request(params?.method ?? 'GET', url, params)
437 .subscribe((r) => (response = r));
438 TestBed.inject(HttpTestingController)
439 .expectOne(url)
440 .flush(body, {headers: params?.responseHeaders ?? params?.headers});
441 return response;
442 }
443
444 function makeRequestAndExpectNone(
445 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