blob: 4727ace20f767f56840530ab4582a9572fb99b6a [file] [log] [blame]
{"version":3,"file":"http__testing.js","sources":["../../../../../../packages/common/http/testing/src/api.ts","../../../../../../packages/common/http/testing/src/request.ts","../../../../../../packages/common/http/testing/src/backend.ts","../../../../../../packages/common/http/testing/src/module.ts","../../../../../../packages/common/http/testing/public_api.ts","../../../../../../packages/common/http/testing/index.ts","../../../../../../packages/common/http/testing/testing.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HttpRequest} from '@angular/common/http';\n\nimport {TestRequest} from './request';\n\n/**\n * Defines a matcher for requests based on URL, method, or both.\n *\n * @publicApi\n */\nexport interface RequestMatch {\n method?: string;\n url?: string;\n}\n\n/**\n * Controller to be injected into tests, that allows for mocking and flushing\n * of requests.\n *\n * @publicApi\n */\nexport abstract class HttpTestingController {\n /**\n * Search for requests that match the given parameter, without any expectations.\n */\n abstract match(match: string|RequestMatch|((req: HttpRequest<any>) => boolean)): TestRequest[];\n\n /**\n * Expect that a single request has been made which matches the given URL, and return its\n * mock.\n *\n * If no such request has been made, or more than one such request has been made, fail with an\n * error message including the given request description, if any.\n */\n abstract expectOne(url: string, description?: string): TestRequest;\n\n /**\n * Expect that a single request has been made which matches the given parameters, and return\n * its mock.\n *\n * If no such request has been made, or more than one such request has been made, fail with an\n * error message including the given request description, if any.\n */\n abstract expectOne(params: RequestMatch, description?: string): TestRequest;\n\n /**\n * Expect that a single request has been made which matches the given predicate function, and\n * return its mock.\n *\n * If no such request has been made, or more than one such request has been made, fail with an\n * error message including the given request description, if any.\n */\n abstract expectOne(matchFn: ((req: HttpRequest<any>) => boolean), description?: string):\n TestRequest;\n\n /**\n * Expect that a single request has been made which matches the given condition, and return\n * its mock.\n *\n * If no such request has been made, or more than one such request has been made, fail with an\n * error message including the given request description, if any.\n */\n abstract expectOne(\n match: string|RequestMatch|((req: HttpRequest<any>) => boolean),\n description?: string): TestRequest;\n\n /**\n * Expect that no requests have been made which match the given URL.\n *\n * If a matching request has been made, fail with an error message including the given request\n * description, if any.\n */\n abstract expectNone(url: string, description?: string): void;\n\n /**\n * Expect that no requests have been made which match the given parameters.\n *\n * If a matching request has been made, fail with an error message including the given request\n * description, if any.\n */\n abstract expectNone(params: RequestMatch, description?: string): void;\n\n /**\n * Expect that no requests have been made which match the given predicate function.\n *\n * If a matching request has been made, fail with an error message including the given request\n * description, if any.\n */\n abstract expectNone(matchFn: ((req: HttpRequest<any>) => boolean), description?: string): void;\n\n /**\n * Expect that no requests have been made which match the given condition.\n *\n * If a matching request has been made, fail with an error message including the given request\n * description, if any.\n */\n abstract expectNone(\n match: string|RequestMatch|((req: HttpRequest<any>) => boolean), description?: string): void;\n\n /**\n * Verify that no unmatched requests are outstanding.\n *\n * If any requests are outstanding, fail with an error message indicating which requests were not\n * handled.\n *\n * If `ignoreCancelled` is not set (the default), `verify()` will also fail if cancelled requests\n * were not explicitly matched.\n */\n abstract verify(opts?: {ignoreCancelled?: boolean}): void;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HttpErrorResponse, HttpEvent, HttpHeaders, HttpRequest, HttpResponse} from '@angular/common/http';\nimport {Observer} from 'rxjs';\n\n/**\n * A mock requests that was received and is ready to be answered.\n *\n * This interface allows access to the underlying `HttpRequest`, and allows\n * responding with `HttpEvent`s or `HttpErrorResponse`s.\n *\n * @publicApi\n */\nexport class TestRequest {\n /**\n * Whether the request was cancelled after it was sent.\n */\n get cancelled(): boolean {\n return this._cancelled;\n }\n\n /**\n * @internal set by `HttpClientTestingBackend`\n */\n _cancelled = false;\n\n constructor(public request: HttpRequest<any>, private observer: Observer<HttpEvent<any>>) {}\n\n /**\n * Resolve the request by returning a body plus additional HTTP information (such as response\n * headers) if provided.\n * If the request specifies an expected body type, the body is converted into the requested type.\n * Otherwise, the body is converted to `JSON` by default.\n *\n * Both successful and unsuccessful responses can be delivered via `flush()`.\n */\n flush(\n body: ArrayBuffer|Blob|boolean|string|number|Object|(boolean|string|number|Object|null)[]|\n null,\n opts: {\n headers?: HttpHeaders|{[name: string]: string | string[]},\n status?: number,\n statusText?: string,\n } = {}): void {\n if (this.cancelled) {\n throw new Error(`Cannot flush a cancelled request.`);\n }\n const url = this.request.urlWithParams;\n const headers =\n (opts.headers instanceof HttpHeaders) ? opts.headers : new HttpHeaders(opts.headers);\n body = _maybeConvertBody(this.request.responseType, body);\n let statusText: string|undefined = opts.statusText;\n let status: number = opts.status !== undefined ? opts.status : 200;\n if (opts.status === undefined) {\n if (body === null) {\n status = 204;\n statusText = statusText || 'No Content';\n } else {\n statusText = statusText || 'OK';\n }\n }\n if (statusText === undefined) {\n throw new Error('statusText is required when setting a custom status.');\n }\n if (status >= 200 && status < 300) {\n this.observer.next(new HttpResponse<any>({body, headers, status, statusText, url}));\n this.observer.complete();\n } else {\n this.observer.error(new HttpErrorResponse({error: body, headers, status, statusText, url}));\n }\n }\n\n /**\n * Resolve the request by returning an `ErrorEvent` (e.g. simulating a network failure).\n */\n error(error: ErrorEvent, opts: {\n headers?: HttpHeaders|{[name: string]: string | string[]},\n status?: number,\n statusText?: string,\n } = {}): void {\n if (this.cancelled) {\n throw new Error(`Cannot return an error for a cancelled request.`);\n }\n if (opts.status && opts.status >= 200 && opts.status < 300) {\n throw new Error(`error() called with a successful status.`);\n }\n const headers =\n (opts.headers instanceof HttpHeaders) ? opts.headers : new HttpHeaders(opts.headers);\n this.observer.error(new HttpErrorResponse({\n error,\n headers,\n status: opts.status || 0,\n statusText: opts.statusText || '',\n url: this.request.urlWithParams,\n }));\n }\n\n /**\n * Deliver an arbitrary `HttpEvent` (such as a progress event) on the response stream for this\n * request.\n */\n event(event: HttpEvent<any>): void {\n if (this.cancelled) {\n throw new Error(`Cannot send events to a cancelled request.`);\n }\n this.observer.next(event);\n }\n}\n\n\n/**\n * Helper function to convert a response body to an ArrayBuffer.\n */\nfunction _toArrayBufferBody(body: ArrayBuffer|Blob|string|number|Object|\n (string | number | Object | null)[]): ArrayBuffer {\n if (typeof ArrayBuffer === 'undefined') {\n throw new Error('ArrayBuffer responses are not supported on this platform.');\n }\n if (body instanceof ArrayBuffer) {\n return body;\n }\n throw new Error('Automatic conversion to ArrayBuffer is not supported for response type.');\n}\n\n/**\n * Helper function to convert a response body to a Blob.\n */\nfunction _toBlob(body: ArrayBuffer|Blob|string|number|Object|\n (string | number | Object | null)[]): Blob {\n if (typeof Blob === 'undefined') {\n throw new Error('Blob responses are not supported on this platform.');\n }\n if (body instanceof Blob) {\n return body;\n }\n if (ArrayBuffer && body instanceof ArrayBuffer) {\n return new Blob([body]);\n }\n throw new Error('Automatic conversion to Blob is not supported for response type.');\n}\n\n/**\n * Helper function to convert a response body to JSON data.\n */\nfunction _toJsonBody(\n body: ArrayBuffer|Blob|boolean|string|number|Object|\n (boolean | string | number | Object | null)[],\n format: string = 'JSON'): Object|string|number|(Object | string | number)[] {\n if (typeof ArrayBuffer !== 'undefined' && body instanceof ArrayBuffer) {\n throw new Error(`Automatic conversion to ${format} is not supported for ArrayBuffers.`);\n }\n if (typeof Blob !== 'undefined' && body instanceof Blob) {\n throw new Error(`Automatic conversion to ${format} is not supported for Blobs.`);\n }\n if (typeof body === 'string' || typeof body === 'number' || typeof body === 'object' ||\n typeof body === 'boolean' || Array.isArray(body)) {\n return body;\n }\n throw new Error(`Automatic conversion to ${format} is not supported for response type.`);\n}\n\n/**\n * Helper function to convert a response body to a string.\n */\nfunction _toTextBody(body: ArrayBuffer|Blob|string|number|Object|\n (string | number | Object | null)[]): string {\n if (typeof body === 'string') {\n return body;\n }\n if (typeof ArrayBuffer !== 'undefined' && body instanceof ArrayBuffer) {\n throw new Error('Automatic conversion to text is not supported for ArrayBuffers.');\n }\n if (typeof Blob !== 'undefined' && body instanceof Blob) {\n throw new Error('Automatic conversion to text is not supported for Blobs.');\n }\n return JSON.stringify(_toJsonBody(body, 'text'));\n}\n\n/**\n * Convert a response body to the requested type.\n */\nfunction _maybeConvertBody(\n responseType: string,\n body: ArrayBuffer|Blob|string|number|Object|(string | number | Object | null)[]|\n null): ArrayBuffer|Blob|string|number|Object|(string | number | Object | null)[]|null {\n if (body === null) {\n return null;\n }\n switch (responseType) {\n case 'arraybuffer':\n return _toArrayBufferBody(body);\n case 'blob':\n return _toBlob(body);\n case 'json':\n return _toJsonBody(body);\n case 'text':\n return _toTextBody(body);\n default:\n throw new Error(`Unsupported responseType: ${responseType}`);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HttpBackend, HttpEvent, HttpEventType, HttpRequest} from '@angular/common/http';\nimport {Injectable} from '@angular/core';\nimport {Observable, Observer} from 'rxjs';\n\nimport {HttpTestingController, RequestMatch} from './api';\nimport {TestRequest} from './request';\n\n\n/**\n * A testing backend for `HttpClient` which both acts as an `HttpBackend`\n * and as the `HttpTestingController`.\n *\n * `HttpClientTestingBackend` works by keeping a list of all open requests.\n * As requests come in, they're added to the list. Users can assert that specific\n * requests were made and then flush them. In the end, a verify() method asserts\n * that no unexpected requests were made.\n *\n *\n */\n@Injectable()\nexport class HttpClientTestingBackend implements HttpBackend, HttpTestingController {\n /**\n * List of pending requests which have not yet been expected.\n */\n private open: TestRequest[] = [];\n\n /**\n * Handle an incoming request by queueing it in the list of open requests.\n */\n handle(req: HttpRequest<any>): Observable<HttpEvent<any>> {\n return new Observable((observer: Observer<any>) => {\n const testReq = new TestRequest(req, observer);\n this.open.push(testReq);\n observer.next({type: HttpEventType.Sent} as HttpEvent<any>);\n return () => {\n testReq._cancelled = true;\n };\n });\n }\n\n /**\n * Helper function to search for requests in the list of open requests.\n */\n private _match(match: string|RequestMatch|((req: HttpRequest<any>) => boolean)): TestRequest[] {\n if (typeof match === 'string') {\n return this.open.filter(testReq => testReq.request.urlWithParams === match);\n } else if (typeof match === 'function') {\n return this.open.filter(testReq => match(testReq.request));\n } else {\n return this.open.filter(\n testReq => (!match.method || testReq.request.method === match.method.toUpperCase()) &&\n (!match.url || testReq.request.urlWithParams === match.url));\n }\n }\n\n /**\n * Search for requests in the list of open requests, and return all that match\n * without asserting anything about the number of matches.\n */\n match(match: string|RequestMatch|((req: HttpRequest<any>) => boolean)): TestRequest[] {\n const results = this._match(match);\n results.forEach(result => {\n const index = this.open.indexOf(result);\n if (index !== -1) {\n this.open.splice(index, 1);\n }\n });\n return results;\n }\n\n /**\n * Expect that a single outstanding request matches the given matcher, and return\n * it.\n *\n * Requests returned through this API will no longer be in the list of open requests,\n * and thus will not match twice.\n */\n expectOne(match: string|RequestMatch|((req: HttpRequest<any>) => boolean), description?: string):\n TestRequest {\n description = description || this.descriptionFromMatcher(match);\n const matches = this.match(match);\n if (matches.length > 1) {\n throw new Error(`Expected one matching request for criteria \"${description}\", found ${\n matches.length} requests.`);\n }\n if (matches.length === 0) {\n let message = `Expected one matching request for criteria \"${description}\", found none.`;\n if (this.open.length > 0) {\n // Show the methods and URLs of open requests in the error, for convenience.\n const requests = this.open\n .map(testReq => {\n const url = testReq.request.urlWithParams;\n const method = testReq.request.method;\n return `${method} ${url}`;\n })\n .join(', ');\n message += ` Requests received are: ${requests}.`;\n }\n throw new Error(message);\n }\n return matches[0];\n }\n\n /**\n * Expect that no outstanding requests match the given matcher, and throw an error\n * if any do.\n */\n expectNone(match: string|RequestMatch|((req: HttpRequest<any>) => boolean), description?: string):\n void {\n description = description || this.descriptionFromMatcher(match);\n const matches = this.match(match);\n if (matches.length > 0) {\n throw new Error(`Expected zero matching requests for criteria \"${description}\", found ${\n matches.length}.`);\n }\n }\n\n /**\n * Validate that there are no outstanding requests.\n */\n verify(opts: {ignoreCancelled?: boolean} = {}): void {\n let open = this.open;\n // It's possible that some requests may be cancelled, and this is expected.\n // The user can ask to ignore open requests which have been cancelled.\n if (opts.ignoreCancelled) {\n open = open.filter(testReq => !testReq.cancelled);\n }\n if (open.length > 0) {\n // Show the methods and URLs of open requests in the error, for convenience.\n const requests = open.map(testReq => {\n const url = testReq.request.urlWithParams.split('?')[0];\n const method = testReq.request.method;\n return `${method} ${url}`;\n })\n .join(', ');\n throw new Error(`Expected no open requests, found ${open.length}: ${requests}`);\n }\n }\n\n private descriptionFromMatcher(matcher: string|RequestMatch|\n ((req: HttpRequest<any>) => boolean)): string {\n if (typeof matcher === 'string') {\n return `Match URL: ${matcher}`;\n } else if (typeof matcher === 'object') {\n const method = matcher.method || '(any)';\n const url = matcher.url || '(any)';\n return `Match method: ${method}, URL: ${url}`;\n } else {\n return `Match by function: ${matcher.name}`;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HttpBackend, HttpClientModule} from '@angular/common/http';\nimport {NgModule} from '@angular/core';\n\nimport {HttpTestingController} from './api';\nimport {HttpClientTestingBackend} from './backend';\n\n\n/**\n * Configures `HttpClientTestingBackend` as the `HttpBackend` used by `HttpClient`.\n *\n * Inject `HttpTestingController` to expect and flush requests in your tests.\n *\n * @publicApi\n */\n@NgModule({\n imports: [\n HttpClientModule,\n ],\n providers: [\n HttpClientTestingBackend,\n {provide: HttpBackend, useExisting: HttpClientTestingBackend},\n {provide: HttpTestingController, useExisting: HttpClientTestingBackend},\n ],\n})\nexport class HttpClientTestingModule {\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport {HttpTestingController, RequestMatch} from './src/api';\nexport {HttpClientTestingModule} from './src/module';\nexport {TestRequest} from './src/request';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {HttpClientTestingBackend as ɵangular_packages_common_http_testing_testing_a} from './src/backend';"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;;;AAsBA;;;;;;MAMsB,qBAAqB;;;AC5B3C;;;;;;;AAWA;;;;;;;;MAQa,WAAW;IAatB,YAAmB,OAAyB,EAAU,QAAkC;QAArE,YAAO,GAAP,OAAO,CAAkB;QAAU,aAAQ,GAAR,QAAQ,CAA0B;;;;QAFxF,eAAU,GAAG,KAAK,CAAC;KAEyE;;;;IAT5F,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;KACxB;;;;;;;;;IAiBD,KAAK,CACD,IACI,EACJ,OAII,EAAE;QACR,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;SACtD;QACD,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;QACvC,MAAM,OAAO,GACT,CAAC,IAAI,CAAC,OAAO,YAAY,WAAW,IAAI,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzF,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QAC1D,IAAI,UAAU,GAAqB,IAAI,CAAC,UAAU,CAAC;QACnD,IAAI,MAAM,GAAW,IAAI,CAAC,MAAM,KAAK,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;QACnE,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE;YAC7B,IAAI,IAAI,KAAK,IAAI,EAAE;gBACjB,MAAM,GAAG,GAAG,CAAC;gBACb,UAAU,GAAG,UAAU,IAAI,YAAY,CAAC;aACzC;iBAAM;gBACL,UAAU,GAAG,UAAU,IAAI,IAAI,CAAC;aACjC;SACF;QACD,IAAI,UAAU,KAAK,SAAS,EAAE;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