UNPKG

35.4 kBSource Map (JSON)View Raw
1{"version":3,"sources":["packages/common/common-http-testing.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","common","http","testing","core","rxjs","this","HttpTestingController","__decorate","decorators","target","key","desc","d","c","arguments","length","r","Object","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","TestRequest","request","observer","_cancelled","prototype","get","enumerable","configurable","flush","body","opts","cancelled","Error","url","urlWithParams","headers","HttpHeaders","_maybeConvertBody","responseType","_toArrayBufferBody","ArrayBuffer","_toBlob","Blob","_toJsonBody","_toTextBody","JSON","stringify","statusText","status","undefined","next","HttpResponse","complete","error","HttpErrorResponse","event","format","Array","isArray","HttpClientTestingBackend","open","handle","req","_this","Observable","testReq","push","type","HttpEventType","Sent","_match","match","filter","method","toUpperCase","results","forEach","result","index","indexOf","splice","expectOne","description","descriptionFromMatcher","matches","message","map","join","expectNone","verify","ignoreCancelled","requests","split","matcher","name","Injectable","HttpClientTestingModule","NgModule","imports","HttpClientModule","providers","provide","HttpBackend","useExisting","ɵangular_packages_common_http_testing_testing_a","value"],"mappings":";;;;;CAMC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,wBAAyBA,QAAQ,iBAAkBA,QAAQ,SACjI,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,+BAAgC,CAAC,UAAW,uBAAwB,gBAAiB,QAASJ,GACxHA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,OAAST,EAAOQ,GAAGC,QAAU,GAAIT,EAAOQ,GAAGC,OAAOC,KAAOV,EAAOQ,GAAGC,OAAOC,MAAQ,GAAIV,EAAOQ,GAAGC,OAAOC,KAAKC,QAAU,IAAKX,EAAOQ,GAAGC,OAAOC,KAAMV,EAAOQ,GAAGI,KAAMZ,EAAOa,MAHvP,CAIEC,MAAM,SAAWZ,EAASQ,EAAME,EAAMC,GAAQ;;;;;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n * (c) 2010-2020 Google LLC. https://angular.io/\n * License: MIT\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common/http'), require('@angular/core'), require('rxjs')) :\n typeof define === 'function' && define.amd ? define('@angular/common/http/testing', ['exports', '@angular/common/http', '@angular/core', 'rxjs'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.common = global.ng.common || {}, global.ng.common.http = global.ng.common.http || {}, global.ng.common.http.testing = {}), global.ng.common.http, global.ng.core, global.rxjs));\n}(this, (function (exports, http, core, rxjs) { 'use strict';\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 * Controller to be injected into tests, that allows for mocking and flushing\n * of requests.\n *\n * @publicApi\n */\n var HttpTestingController = /** @class */ (function () {\n function HttpTestingController() {\n }\n return HttpTestingController;\n }());\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation. All rights reserved.\r\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\n this file except in compliance with the License. You may obtain a copy of the\r\n License at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\n WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\n MERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\n See the Apache Version 2.0 License for specific language governing permissions\r\n and limitations under the License.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise */\r\n\r\n var extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n\r\n function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n }\r\n\r\n var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n };\r\n\r\n function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n }\r\n\r\n function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n }\r\n\r\n function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n }\r\n\r\n function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n }\r\n\r\n function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n }\r\n\r\n function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n }\r\n\r\n function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n }\r\n\r\n function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n }\r\n\r\n function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n }\r\n\r\n function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n }\r\n\r\n function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n };\r\n\r\n function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n }\r\n\r\n function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n }\r\n\r\n function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n }\r\n\r\n function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n }\r\n\r\n function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n };\r\n\r\n function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n }\r\n\r\n function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n }\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 * 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 */\n var TestRequest = /** @class */ (function () {\n function TestRequest(request, observer) {\n this.request = request;\n this.observer = observer;\n /**\n * @internal set by `HttpClientTestingBackend`\n */\n this._cancelled = false;\n }\n Object.defineProperty(TestRequest.prototype, \"cancelled\", {\n /**\n * Whether the request was cancelled after it was sent.\n */\n get: function () { return this._cancelled; },\n enumerable: true,\n configurable: true\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 TestRequest.prototype.flush = function (body, opts) {\n if (opts === void 0) { opts = {}; }\n if (this.cancelled) {\n throw new Error(\"Cannot flush a cancelled request.\");\n }\n var url = this.request.urlWithParams;\n var headers = (opts.headers instanceof http.HttpHeaders) ? opts.headers : new http.HttpHeaders(opts.headers);\n body = _maybeConvertBody(this.request.responseType, body);\n var statusText = opts.statusText;\n var 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 http.HttpResponse({ body: body, headers: headers, status: status, statusText: statusText, url: url }));\n this.observer.complete();\n }\n else {\n this.observer.error(new http.HttpErrorResponse({ error: body, headers: headers, status: status, statusText: statusText, url: url }));\n }\n };\n /**\n * Resolve the request by returning an `ErrorEvent` (e.g. simulating a network failure).\n */\n TestRequest.prototype.error = function (error, opts) {\n if (opts === void 0) { 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 var headers = (opts.headers instanceof http.HttpHeaders) ? opts.headers : new http.HttpHeaders(opts.headers);\n this.observer.error(new http.HttpErrorResponse({\n error: error,\n headers: 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 */\n TestRequest.prototype.event = function (event) {\n if (this.cancelled) {\n throw new Error(\"Cannot send events to a cancelled request.\");\n }\n this.observer.next(event);\n };\n return TestRequest;\n }());\n /**\n * Helper function to convert a response body to an ArrayBuffer.\n */\n function _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 */\n function _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 */\n function _toJsonBody(body, format) {\n if (format === void 0) { 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 */\n function _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 */\n function _maybeConvertBody(responseType, body) {\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 /**\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 * 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 var HttpClientTestingBackend = /** @class */ (function () {\n function HttpClientTestingBackend() {\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 */\n HttpClientTestingBackend.prototype.handle = function (req) {\n var _this = this;\n return new rxjs.Observable(function (observer) {\n var testReq = new TestRequest(req, observer);\n _this.open.push(testReq);\n observer.next({ type: http.HttpEventType.Sent });\n return function () { testReq._cancelled = true; };\n });\n };\n /**\n * Helper function to search for requests in the list of open requests.\n */\n HttpClientTestingBackend.prototype._match = function (match) {\n if (typeof match === 'string') {\n return this.open.filter(function (testReq) { return testReq.request.urlWithParams === match; });\n }\n else if (typeof match === 'function') {\n return this.open.filter(function (testReq) { return match(testReq.request); });\n }\n else {\n return this.open.filter(function (testReq) { return (!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 */\n HttpClientTestingBackend.prototype.match = function (match) {\n var _this = this;\n var results = this._match(match);\n results.forEach(function (result) {\n var 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 */\n HttpClientTestingBackend.prototype.expectOne = function (match, description) {\n description = description || this.descriptionFromMatcher(match);\n var 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 var 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 var requests = this.open\n .map(function (testReq) {\n var url = testReq.request.urlWithParams;\n var 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 * Expect that no outstanding requests match the given matcher, and throw an error\n * if any do.\n */\n HttpClientTestingBackend.prototype.expectNone = function (match, description) {\n description = description || this.descriptionFromMatcher(match);\n var 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 */\n HttpClientTestingBackend.prototype.verify = function (opts) {\n if (opts === void 0) { opts = {}; }\n var 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(function (testReq) { return !testReq.cancelled; });\n }\n if (open.length > 0) {\n // Show the methods and URLs of open requests in the error, for convenience.\n var requests = open.map(function (testReq) {\n var url = testReq.request.urlWithParams.split('?')[0];\n var 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 HttpClientTestingBackend.prototype.descriptionFromMatcher = function (matcher) {\n if (typeof matcher === 'string') {\n return \"Match URL: \" + matcher;\n }\n else if (typeof matcher === 'object') {\n var method = matcher.method || '(any)';\n var url = matcher.url || '(any)';\n return \"Match method: \" + method + \", URL: \" + url;\n }\n else {\n return \"Match by function: \" + matcher.name;\n }\n };\n HttpClientTestingBackend = __decorate([\n core.Injectable()\n ], HttpClientTestingBackend);\n return HttpClientTestingBackend;\n }());\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 * 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 var HttpClientTestingModule = /** @class */ (function () {\n function HttpClientTestingModule() {\n }\n HttpClientTestingModule = __decorate([\n core.NgModule({\n imports: [\n http.HttpClientModule,\n ],\n providers: [\n HttpClientTestingBackend,\n { provide: http.HttpBackend, useExisting: HttpClientTestingBackend },\n { provide: HttpTestingController, useExisting: HttpClientTestingBackend },\n ],\n })\n ], HttpClientTestingModule);\n return HttpClientTestingModule;\n }());\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 /**\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 /**\n * Generated bundle index. Do not edit.\n */\n\n exports.HttpClientTestingModule = HttpClientTestingModule;\n exports.HttpTestingController = HttpTestingController;\n exports.TestRequest = TestRequest;\n exports.ɵangular_packages_common_http_testing_testing_a = HttpClientTestingBackend;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=common-http-testing.umd.js.map\n"]}
\No newline at end of file