MCPcopy Index your code
hub / github.com/angular/angular / makeRequestAndExpectOne

Function makeRequestAndExpectOne

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

Source from the content-addressed store, hash-verified

309 params?: RequestParams & {observe: 'response'},
310 ): HttpResponse<string>;
311 function makeRequestAndExpectOne(url: string, body: RequestBody, params?: RequestParams): any {
312 let response!: any;
313 TestBed.inject(HttpClient)
314 .request(params?.method ?? 'GET', url, params)
315 .subscribe((r) => (response = r));
316 TestBed.inject(HttpTestingController)
317 .expectOne(url)
318 .flush(body, {headers: params?.responseHeaders ?? params?.headers});
319 return response;
320 }
321
322 function makeRequestAndExpectNone(
323 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…