blob: 43056bcf2842dd8459f8e6e40f5bdee57667d7cc [file] [log] [blame]
{"version":3,"file":"testing.js","sources":["../../../../packages/common/http/testing/src/api.js","../../../../packages/common/http/testing/src/request.js","../../../../packages/common/http/testing/src/backend.js","../../../../packages/common/http/testing/src/module.js","../../../../packages/common/http/testing/public_api.js","../../../../packages/common/http/testing/testing.js"],"sourcesContent":["/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. 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/**\n * Defines a matcher for requests based on URL, method, or both.\n *\n * \\@stable\n * @record\n */\nexport function RequestMatch() { }\nfunction RequestMatch_tsickle_Closure_declarations() {\n /** @type {?|undefined} */\n RequestMatch.prototype.method;\n /** @type {?|undefined} */\n RequestMatch.prototype.url;\n}\n/**\n * Controller to be injected into tests, that allows for mocking and flushing\n * of requests.\n *\n * \\@stable\n * @abstract\n */\nexport class HttpTestingController {\n}\nfunction HttpTestingController_tsickle_Closure_declarations() {\n /**\n * Search for requests that match the given parameter, without any expectations.\n * @abstract\n * @param {?} match\n * @return {?}\n */\n HttpTestingController.prototype.match = function (match) { };\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 * @abstract\n * @param {?} url\n * @param {?=} description\n * @return {?}\n */\n HttpTestingController.prototype.expectOne = function (url, description) { };\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 * @abstract\n * @param {?} params\n * @param {?=} description\n * @return {?}\n */\n HttpTestingController.prototype.expectOne = function (params, description) { };\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 * @abstract\n * @param {?} matchFn\n * @param {?=} description\n * @return {?}\n */\n HttpTestingController.prototype.expectOne = function (matchFn, description) { };\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 * @abstract\n * @param {?} match\n * @param {?=} description\n * @return {?}\n */\n HttpTestingController.prototype.expectOne = function (match, description) { };\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 * @abstract\n * @param {?} url\n * @param {?=} description\n * @return {?}\n */\n HttpTestingController.prototype.expectNone = function (url, description) { };\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 * @abstract\n * @param {?} params\n * @param {?=} description\n * @return {?}\n */\n HttpTestingController.prototype.expectNone = function (params, description) { };\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 * @abstract\n * @param {?} matchFn\n * @param {?=} description\n * @return {?}\n */\n HttpTestingController.prototype.expectNone = function (matchFn, description) { };\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 * @abstract\n * @param {?} match\n * @param {?=} description\n * @return {?}\n */\n HttpTestingController.prototype.expectNone = function (match, description) { };\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 * @abstract\n * @param {?=} opts\n * @return {?}\n */\n HttpTestingController.prototype.verify = function (opts) { };\n}\n//# sourceMappingURL=api.js.map","/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. 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 */\nimport { HttpErrorResponse, HttpHeaders, HttpResponse } from '@angular/common/http';\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 * \\@stable\n */\nexport class TestRequest {\n /**\n * @param {?} request\n * @param {?} observer\n */\n constructor(request, observer) {\n this.request = request;\n this.observer = observer;\n /**\n * \\@internal set by `HttpClientTestingBackend`\n */\n this._cancelled = false;\n }\n /**\n * Whether the request was cancelled after it was sent.\n * @return {?}\n */\n get cancelled() { return this._cancelled; }\n /**\n * Resolve the request by returning a body plus additional HTTP information (such as response\n * headers) if provided.\n *\n * Both successful and unsuccessful responses can be delivered via `flush()`.\n * @param {?} body\n * @param {?=} opts\n * @return {?}\n */\n flush(body, opts = {}) {\n if (this.cancelled) {\n throw new Error(`Cannot flush a cancelled request.`);\n }\n const /** @type {?} */ url = this.request.urlWithParams;\n const /** @type {?} */ headers = (opts.headers instanceof HttpHeaders) ? opts.headers : new HttpHeaders(opts.headers);\n body = _maybeConvertBody(this.request.responseType, body);\n let /** @type {?} */ statusText = opts.statusText;\n let /** @type {?} */ status = opts.status !== undefined ? opts.status : 200;\n if (opts.status === undefined) {\n if (body === null) {\n status = 204;\n statusText = statusText || 'No Content';\n }\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({ body, headers, status, statusText, url }));\n this.observer.complete();\n }\n else {\n this.observer.error(new HttpErrorResponse({ error: body, headers, status, statusText, url }));\n }\n }\n /**\n * Resolve the request by returning an `ErrorEvent` (e.g. simulating a network failure).\n * @param {?} error\n * @param {?=} opts\n * @return {?}\n */\n error(error, opts = {}) {\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 /** @type {?} */ headers = (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 * Deliver an arbitrary `HttpEvent` (such as a progress event) on the response stream for this\n * request.\n * @param {?} event\n * @return {?}\n */\n event(event) {\n if (this.cancelled) {\n throw new Error(`Cannot send events to a cancelled request.`);\n }\n this.observer.next(event);\n }\n}\nfunction TestRequest_tsickle_Closure_declarations() {\n /**\n * \\@internal set by `HttpClientTestingBackend`\n * @type {?}\n */\n TestRequest.prototype._cancelled;\n /** @type {?} */\n TestRequest.prototype.request;\n /** @type {?} */\n TestRequest.prototype.observer;\n}\n/**\n * Helper function to convert a response body to an ArrayBuffer.\n * @param {?} body\n * @return {?}\n */\nfunction _toArrayBufferBody(body) {\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 * Helper function to convert a response body to a Blob.\n * @param {?} body\n * @return {?}\n */\nfunction _toBlob(body) {\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 * Helper function to convert a response body to JSON data.\n * @param {?} body\n * @param {?=} format\n * @return {?}\n */\nfunction _toJsonBody(body, format = 'JSON') {\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 Array.isArray(body)) {\n return body;\n }\n throw new Error(`Automatic conversion to ${format} is not supported for response type.`);\n}\n/**\n * Helper function to convert a response body to a string.\n * @param {?} body\n * @return {?}\n */\nfunction _toTextBody(body) {\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 * Convert a response body to the requested type.\n * @param {?} responseType\n * @param {?} body\n * @return {?}\n */\nfunction _maybeConvertBody(responseType, body) {\n switch (responseType) {\n case 'arraybuffer':\n if (body === null) {\n return null;\n }\n return _toArrayBufferBody(body);\n case 'blob':\n if (body === null) {\n return null;\n }\n return _toBlob(body);\n case 'json':\n if (body === null) {\n return 'null';\n }\n return _toJsonBody(body);\n case 'text':\n if (body === null) {\n return null;\n }\n return _toTextBody(body);\n default:\n throw new Error(`Unsupported responseType: ${responseType}`);\n }\n}\n//# sourceMappingURL=request.js.map","/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. 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 */\nimport { HttpEventType } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs/Observable';\nimport { TestRequest } from './request';\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 * \\@stable\n */\nexport class HttpClientTestingBackend {\n constructor() {\n /**\n * List of pending requests which have not yet been expected.\n */\n this.open = [];\n }\n /**\n * Handle an incoming request by queueing it in the list of open requests.\n * @param {?} req\n * @return {?}\n */\n handle(req) {\n return new Observable((observer) => {\n const /** @type {?} */ testReq = new TestRequest(req, observer);\n this.open.push(testReq);\n observer.next(/** @type {?} */ ({ type: HttpEventType.Sent }));\n return () => { testReq._cancelled = true; };\n });\n }\n /**\n * Helper function to search for requests in the list of open requests.\n * @param {?} match\n * @return {?}\n */\n _match(match) {\n if (typeof match === 'string') {\n return this.open.filter(testReq => testReq.request.urlWithParams === match);\n }\n else if (typeof match === 'function') {\n return this.open.filter(testReq => match(testReq.request));\n }\n else {\n return this.open.filter(testReq => (!match.method || testReq.request.method === match.method.toUpperCase()) &&\n (!match.url || testReq.request.urlWithParams === match.url));\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 * @param {?} match\n * @return {?}\n */\n match(match) {\n const /** @type {?} */ results = this._match(match);\n results.forEach(result => {\n const /** @type {?} */ index = this.open.indexOf(result);\n if (index !== -1) {\n this.open.splice(index, 1);\n }\n });\n return results;\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 * @param {?} match\n * @param {?=} description\n * @return {?}\n */\n expectOne(match, description) {\n description = description || this.descriptionFromMatcher(match);\n const /** @type {?} */ matches = this.match(match);\n if (matches.length > 1) {\n throw new Error(`Expected one matching request for criteria \"${description}\", found ${matches.length} requests.`);\n }\n if (matches.length === 0) {\n throw new Error(`Expected one matching request for criteria \"${description}\", found none.`);\n }\n return matches[0];\n }\n /**\n * Expect that no outstanding requests match the given matcher, and throw an error\n * if any do.\n * @param {?} match\n * @param {?=} description\n * @return {?}\n */\n expectNone(match, description) {\n description = description || this.descriptionFromMatcher(match);\n const /** @type {?} */ matches = this.match(match);\n if (matches.length > 0) {\n throw new Error(`Expected zero matching requests for criteria \"${description}\", found ${matches.length}.`);\n }\n }\n /**\n * Validate that there are no outstanding requests.\n * @param {?=} opts\n * @return {?}\n */\n verify(opts = {}) {\n let /** @type {?} */ 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 /** @type {?} */ requests = open.map(testReq => {\n const /** @type {?} */ url = testReq.request.urlWithParams.split('?')[0];\n const /** @type {?} */ 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 * @param {?} matcher\n * @return {?}\n */\n descriptionFromMatcher(matcher) {\n if (typeof matcher === 'string') {\n return `Match URL: ${matcher}`;\n }\n else if (typeof matcher === 'object') {\n const /** @type {?} */ method = matcher.method || '(any)';\n const /** @type {?} */ url = matcher.url || '(any)';\n return `Match method: ${method}, URL: ${url}`;\n }\n else {\n return `Match by function: ${matcher.name}`;\n }\n }\n}\nHttpClientTestingBackend.decorators = [\n { type: Injectable },\n];\n/** @nocollapse */\nHttpClientTestingBackend.ctorParameters = () => [];\nfunction HttpClientTestingBackend_tsickle_Closure_declarations() {\n /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */\n HttpClientTestingBackend.decorators;\n /**\n * @nocollapse\n * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>}\n */\n HttpClientTestingBackend.ctorParameters;\n /**\n * List of pending requests which have not yet been expected.\n * @type {?}\n */\n HttpClientTestingBackend.prototype.open;\n}\n//# sourceMappingURL=backend.js.map","/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. 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 */\nimport { HttpBackend, HttpClientModule } from '@angular/common/http';\nimport { NgModule } from '@angular/core';\nimport { HttpTestingController } from './api';\nimport { HttpClientTestingBackend } from './backend';\n/**\n * Configures `HttpClientTestingBackend` as the `HttpBackend` used by `HttpClient`.\n *\n * Inject `HttpTestingController` to expect and flush requests in your tests.\n *\n * \\@stable\n */\nexport class HttpClientTestingModule {\n}\nHttpClientTestingModule.decorators = [\n { type: NgModule, args: [{\n imports: [\n HttpClientModule,\n ],\n providers: [\n HttpClientTestingBackend,\n { provide: HttpBackend, useExisting: HttpClientTestingBackend },\n { provide: HttpTestingController, useExisting: HttpClientTestingBackend },\n ],\n },] },\n];\n/** @nocollapse */\nHttpClientTestingModule.ctorParameters = () => [];\nfunction HttpClientTestingModule_tsickle_Closure_declarations() {\n /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */\n HttpClientTestingModule.decorators;\n /**\n * @nocollapse\n * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>}\n */\n HttpClientTestingModule.ctorParameters;\n}\n//# sourceMappingURL=module.js.map","/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. 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 */\nexport { HttpTestingController } from './src/api';\nexport { HttpClientTestingModule } from './src/module';\nexport { TestRequest } from './src/request';\n//# sourceMappingURL=public_api.js.map","/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * Generated bundle index. Do not edit.\n */\nexport { HttpTestingController, HttpClientTestingModule, TestRequest } from './public_api';\nexport { HttpClientTestingBackend as ɵa } from './src/backend';\n//# sourceMappingURL=testing.js.map"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;;;;AAiBA,AAAkC;AAClC,AAMA;;;;;;;AAOA,AAAO,MAAM,qBAAqB,CAAC;CAClC;;AChCD;;;;;;;;;;;AAWA,AACA;;;;;;;;AAQA,AAAO,MAAM,WAAW,CAAC;;;;;IAKrB,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE;QAC3B,IAAI,CAAC,OAAO,GAA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