@alterior/http 3.13.3 → 3.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/dist/backend.d.ts +38 -38
  2. package/dist/backend.js +38 -38
  3. package/dist/client.d.ts +2108 -2108
  4. package/dist/client.js +265 -265
  5. package/dist/client.js.map +1 -1
  6. package/dist/headers.d.ts +57 -57
  7. package/dist/headers.js +187 -187
  8. package/dist/headers.js.map +1 -1
  9. package/dist/index.d.ts +18 -18
  10. package/dist/index.js +42 -42
  11. package/dist/interceptor.d.ts +63 -63
  12. package/dist/interceptor.js +43 -43
  13. package/dist/interceptor.js.map +1 -1
  14. package/dist/module.d.ts +101 -101
  15. package/dist/module.js +188 -188
  16. package/dist/module.js.map +1 -1
  17. package/dist/params.d.ts +98 -98
  18. package/dist/params.js +184 -184
  19. package/dist/params.js.map +1 -1
  20. package/dist/request.d.ts +130 -130
  21. package/dist/request.js +260 -260
  22. package/dist/request.js.map +1 -1
  23. package/dist/response.d.ts +267 -267
  24. package/dist/response.js +165 -165
  25. package/dist/response.js.map +1 -1
  26. package/dist/server.d.ts +28 -28
  27. package/dist/server.js +119 -119
  28. package/dist/server.js.map +1 -1
  29. package/dist/test/client.test.d.ts +8 -8
  30. package/dist/test/client.test.js +163 -163
  31. package/dist/test/client.test.js.map +1 -1
  32. package/dist/test/headers.test.d.ts +1 -1
  33. package/dist/test/headers.test.js +126 -126
  34. package/dist/test/module.test.d.ts +1 -1
  35. package/dist/test/module.test.js +117 -117
  36. package/dist/test/module.test.js.map +1 -1
  37. package/dist/test/params.test.d.ts +1 -1
  38. package/dist/test/params.test.js +63 -63
  39. package/dist/test/request.test.d.ts +8 -8
  40. package/dist/test/request.test.js +159 -159
  41. package/dist/test/request.test.js.map +1 -1
  42. package/dist/test/response.test.d.ts +1 -1
  43. package/dist/test/response.test.js +79 -79
  44. package/dist/test/response.test.js.map +1 -1
  45. package/dist/test/test.d.ts +1 -1
  46. package/dist/test/test.js +16 -16
  47. package/dist/test/xhr.mock.d.ts +48 -48
  48. package/dist/test/xhr.mock.js +94 -94
  49. package/dist/test/xhr.mock.js.map +1 -1
  50. package/dist/test/xhr.test.d.ts +1 -1
  51. package/dist/test/xhr.test.js +344 -344
  52. package/dist/test/xhr.test.js.map +1 -1
  53. package/dist/test/xsrf.test.d.ts +1 -1
  54. package/dist/test/xsrf.test.js +63 -63
  55. package/dist/test/xsrf.test.js.map +1 -1
  56. package/dist/testing/api.d.ts +102 -102
  57. package/dist/testing/api.js +19 -19
  58. package/dist/testing/backend.d.ts +63 -63
  59. package/dist/testing/backend.js +141 -141
  60. package/dist/testing/backend.js.map +1 -1
  61. package/dist/testing/index.d.ts +10 -10
  62. package/dist/testing/index.js +16 -16
  63. package/dist/testing/module.d.ts +16 -16
  64. package/dist/testing/module.js +38 -38
  65. package/dist/testing/module.js.map +1 -1
  66. package/dist/testing/request.d.ts +56 -56
  67. package/dist/testing/request.js +177 -177
  68. package/dist/testing/request.js.map +1 -1
  69. package/dist/testing/request.test.d.ts +8 -8
  70. package/dist/testing/request.test.js +24 -24
  71. package/dist/xhr.d.ts +42 -42
  72. package/dist/xhr.js +298 -298
  73. package/dist/xhr.js.map +1 -1
  74. package/dist/xsrf.d.ts +37 -37
  75. package/dist/xsrf.js +55 -55
  76. package/dist/xsrf.js.map +1 -1
  77. package/dist.esm/backend.d.ts +38 -38
  78. package/dist.esm/backend.js +33 -33
  79. package/dist.esm/client.d.ts +2108 -2108
  80. package/dist.esm/client.js +262 -262
  81. package/dist.esm/client.js.map +1 -1
  82. package/dist.esm/headers.d.ts +57 -57
  83. package/dist.esm/headers.js +183 -183
  84. package/dist.esm/headers.js.map +1 -1
  85. package/dist.esm/index.d.ts +18 -18
  86. package/dist.esm/index.js +18 -18
  87. package/dist.esm/interceptor.d.ts +63 -63
  88. package/dist.esm/interceptor.js +39 -39
  89. package/dist.esm/interceptor.js.map +1 -1
  90. package/dist.esm/module.d.ts +101 -101
  91. package/dist.esm/module.js +183 -183
  92. package/dist.esm/module.js.map +1 -1
  93. package/dist.esm/params.d.ts +98 -98
  94. package/dist.esm/params.js +179 -179
  95. package/dist.esm/params.js.map +1 -1
  96. package/dist.esm/request.d.ts +130 -130
  97. package/dist.esm/request.js +256 -256
  98. package/dist.esm/request.js.map +1 -1
  99. package/dist.esm/response.d.ts +267 -267
  100. package/dist.esm/response.js +158 -158
  101. package/dist.esm/response.js.map +1 -1
  102. package/dist.esm/server.d.ts +28 -28
  103. package/dist.esm/server.js +113 -113
  104. package/dist.esm/server.js.map +1 -1
  105. package/dist.esm/test/client.test.d.ts +8 -8
  106. package/dist.esm/test/client.test.js +161 -161
  107. package/dist.esm/test/client.test.js.map +1 -1
  108. package/dist.esm/test/headers.test.d.ts +1 -1
  109. package/dist.esm/test/headers.test.js +124 -124
  110. package/dist.esm/test/module.test.d.ts +1 -1
  111. package/dist.esm/test/module.test.js +115 -115
  112. package/dist.esm/test/module.test.js.map +1 -1
  113. package/dist.esm/test/params.test.d.ts +1 -1
  114. package/dist.esm/test/params.test.js +61 -61
  115. package/dist.esm/test/request.test.d.ts +8 -8
  116. package/dist.esm/test/request.test.js +157 -157
  117. package/dist.esm/test/request.test.js.map +1 -1
  118. package/dist.esm/test/response.test.d.ts +1 -1
  119. package/dist.esm/test/response.test.js +77 -77
  120. package/dist.esm/test/response.test.js.map +1 -1
  121. package/dist.esm/test/test.d.ts +1 -1
  122. package/dist.esm/test/test.js +14 -14
  123. package/dist.esm/test/xhr.mock.d.ts +48 -48
  124. package/dist.esm/test/xhr.mock.js +88 -88
  125. package/dist.esm/test/xhr.mock.js.map +1 -1
  126. package/dist.esm/test/xhr.test.d.ts +1 -1
  127. package/dist.esm/test/xhr.test.js +342 -342
  128. package/dist.esm/test/xhr.test.js.map +1 -1
  129. package/dist.esm/test/xsrf.test.d.ts +1 -1
  130. package/dist.esm/test/xsrf.test.js +61 -61
  131. package/dist.esm/test/xsrf.test.js.map +1 -1
  132. package/dist.esm/testing/api.d.ts +102 -102
  133. package/dist.esm/testing/api.js +15 -15
  134. package/dist.esm/testing/backend.d.ts +63 -63
  135. package/dist.esm/testing/backend.js +138 -138
  136. package/dist.esm/testing/backend.js.map +1 -1
  137. package/dist.esm/testing/index.d.ts +10 -10
  138. package/dist.esm/testing/index.js +10 -10
  139. package/dist.esm/testing/module.d.ts +16 -16
  140. package/dist.esm/testing/module.js +35 -35
  141. package/dist.esm/testing/module.js.map +1 -1
  142. package/dist.esm/testing/request.d.ts +56 -56
  143. package/dist.esm/testing/request.js +173 -173
  144. package/dist.esm/testing/request.js.map +1 -1
  145. package/dist.esm/testing/request.test.d.ts +8 -8
  146. package/dist.esm/testing/request.test.js +22 -22
  147. package/dist.esm/xhr.d.ts +42 -42
  148. package/dist.esm/xhr.js +294 -294
  149. package/dist.esm/xhr.js.map +1 -1
  150. package/dist.esm/xsrf.d.ts +37 -37
  151. package/dist.esm/xsrf.js +51 -51
  152. package/dist.esm/xsrf.js.map +1 -1
  153. package/package.json +9 -9
  154. package/tsconfig.esm.tsbuildinfo +1 -0
  155. package/tsconfig.json +0 -2
  156. package/tsconfig.tsbuildinfo +1 -8046
@@ -1,142 +1,142 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google Inc. All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.HttpClientTestingBackend = void 0;
11
- const tslib_1 = require("tslib");
12
- const response_1 = require("../response");
13
- const di_1 = require("@alterior/di");
14
- const rxjs_1 = require("rxjs");
15
- const request_1 = require("./request");
16
- /**
17
- * A testing backend for `HttpClient` which both acts as an `HttpBackend`
18
- * and as the `HttpTestingController`.
19
- *
20
- * `HttpClientTestingBackend` works by keeping a list of all open requests.
21
- * As requests come in, they're added to the list. Users can assert that specific
22
- * requests were made and then flush them. In the end, a verify() method asserts
23
- * that no unexpected requests were made.
24
- *
25
- *
26
- */
27
- let HttpClientTestingBackend = class HttpClientTestingBackend {
28
- constructor() {
29
- /**
30
- * List of pending requests which have not yet been expected.
31
- */
32
- this.open = [];
33
- }
34
- /**
35
- * Handle an incoming request by queueing it in the list of open requests.
36
- */
37
- handle(req) {
38
- return new rxjs_1.Observable((observer) => {
39
- const testReq = new request_1.TestRequest(req, observer);
40
- this.open.push(testReq);
41
- observer.next({ type: response_1.HttpEventType.Sent });
42
- return () => { testReq._cancelled = true; };
43
- });
44
- }
45
- /**
46
- * Helper function to search for requests in the list of open requests.
47
- */
48
- _match(match) {
49
- if (typeof match === 'string') {
50
- return this.open.filter(testReq => testReq.request.urlWithParams === match);
51
- }
52
- else if (typeof match === 'function') {
53
- return this.open.filter(testReq => match(testReq.request));
54
- }
55
- else {
56
- return this.open.filter(testReq => (!match.method || testReq.request.method === match.method.toUpperCase()) &&
57
- (!match.url || testReq.request.urlWithParams === match.url));
58
- }
59
- }
60
- /**
61
- * Search for requests in the list of open requests, and return all that match
62
- * without asserting anything about the number of matches.
63
- */
64
- match(match) {
65
- const results = this._match(match);
66
- results.forEach(result => {
67
- const index = this.open.indexOf(result);
68
- if (index !== -1) {
69
- this.open.splice(index, 1);
70
- }
71
- });
72
- return results;
73
- }
74
- /**
75
- * Expect that a single outstanding request matches the given matcher, and return
76
- * it.
77
- *
78
- * Requests returned through this API will no longer be in the list of open requests,
79
- * and thus will not match twice.
80
- */
81
- expectOne(match, description) {
82
- description = description || this.descriptionFromMatcher(match);
83
- const matches = this.match(match);
84
- if (matches.length > 1) {
85
- throw new Error(`Expected one matching request for criteria "${description}", found ${matches.length} requests.`);
86
- }
87
- if (matches.length === 0) {
88
- throw new Error(`Expected one matching request for criteria "${description}", found none.`);
89
- }
90
- return matches[0];
91
- }
92
- /**
93
- * Expect that no outstanding requests match the given matcher, and throw an error
94
- * if any do.
95
- */
96
- expectNone(match, description) {
97
- description = description || this.descriptionFromMatcher(match);
98
- const matches = this.match(match);
99
- if (matches.length > 0) {
100
- throw new Error(`Expected zero matching requests for criteria "${description}", found ${matches.length}.`);
101
- }
102
- }
103
- /**
104
- * Validate that there are no outstanding requests.
105
- */
106
- verify(opts = {}) {
107
- let open = this.open;
108
- // It's possible that some requests may be cancelled, and this is expected.
109
- // The user can ask to ignore open requests which have been cancelled.
110
- if (opts.ignoreCancelled) {
111
- open = open.filter(testReq => !testReq.cancelled);
112
- }
113
- if (open.length > 0) {
114
- // Show the methods and URLs of open requests in the error, for convenience.
115
- const requests = open.map(testReq => {
116
- const url = testReq.request.urlWithParams.split('?')[0];
117
- const method = testReq.request.method;
118
- return `${method} ${url}`;
119
- })
120
- .join(', ');
121
- throw new Error(`Expected no open requests, found ${open.length}: ${requests}`);
122
- }
123
- }
124
- descriptionFromMatcher(matcher) {
125
- if (typeof matcher === 'string') {
126
- return `Match URL: ${matcher}`;
127
- }
128
- else if (typeof matcher === 'object') {
129
- const method = matcher.method || '(any)';
130
- const url = matcher.url || '(any)';
131
- return `Match method: ${method}, URL: ${url}`;
132
- }
133
- else {
134
- return `Match by function: ${matcher.name}`;
135
- }
136
- }
137
- };
138
- HttpClientTestingBackend = tslib_1.__decorate([
139
- (0, di_1.Injectable)()
140
- ], HttpClientTestingBackend);
141
- exports.HttpClientTestingBackend = HttpClientTestingBackend;
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google Inc. All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.HttpClientTestingBackend = void 0;
11
+ const tslib_1 = require("tslib");
12
+ const response_1 = require("../response");
13
+ const di_1 = require("@alterior/di");
14
+ const rxjs_1 = require("rxjs");
15
+ const request_1 = require("./request");
16
+ /**
17
+ * A testing backend for `HttpClient` which both acts as an `HttpBackend`
18
+ * and as the `HttpTestingController`.
19
+ *
20
+ * `HttpClientTestingBackend` works by keeping a list of all open requests.
21
+ * As requests come in, they're added to the list. Users can assert that specific
22
+ * requests were made and then flush them. In the end, a verify() method asserts
23
+ * that no unexpected requests were made.
24
+ *
25
+ *
26
+ */
27
+ let HttpClientTestingBackend = class HttpClientTestingBackend {
28
+ constructor() {
29
+ /**
30
+ * List of pending requests which have not yet been expected.
31
+ */
32
+ this.open = [];
33
+ }
34
+ /**
35
+ * Handle an incoming request by queueing it in the list of open requests.
36
+ */
37
+ handle(req) {
38
+ return new rxjs_1.Observable((observer) => {
39
+ const testReq = new request_1.TestRequest(req, observer);
40
+ this.open.push(testReq);
41
+ observer.next({ type: response_1.HttpEventType.Sent });
42
+ return () => { testReq._cancelled = true; };
43
+ });
44
+ }
45
+ /**
46
+ * Helper function to search for requests in the list of open requests.
47
+ */
48
+ _match(match) {
49
+ if (typeof match === 'string') {
50
+ return this.open.filter(testReq => testReq.request.urlWithParams === match);
51
+ }
52
+ else if (typeof match === 'function') {
53
+ return this.open.filter(testReq => match(testReq.request));
54
+ }
55
+ else {
56
+ return this.open.filter(testReq => (!match.method || testReq.request.method === match.method.toUpperCase()) &&
57
+ (!match.url || testReq.request.urlWithParams === match.url));
58
+ }
59
+ }
60
+ /**
61
+ * Search for requests in the list of open requests, and return all that match
62
+ * without asserting anything about the number of matches.
63
+ */
64
+ match(match) {
65
+ const results = this._match(match);
66
+ results.forEach(result => {
67
+ const index = this.open.indexOf(result);
68
+ if (index !== -1) {
69
+ this.open.splice(index, 1);
70
+ }
71
+ });
72
+ return results;
73
+ }
74
+ /**
75
+ * Expect that a single outstanding request matches the given matcher, and return
76
+ * it.
77
+ *
78
+ * Requests returned through this API will no longer be in the list of open requests,
79
+ * and thus will not match twice.
80
+ */
81
+ expectOne(match, description) {
82
+ description = description || this.descriptionFromMatcher(match);
83
+ const matches = this.match(match);
84
+ if (matches.length > 1) {
85
+ throw new Error(`Expected one matching request for criteria "${description}", found ${matches.length} requests.`);
86
+ }
87
+ if (matches.length === 0) {
88
+ throw new Error(`Expected one matching request for criteria "${description}", found none.`);
89
+ }
90
+ return matches[0];
91
+ }
92
+ /**
93
+ * Expect that no outstanding requests match the given matcher, and throw an error
94
+ * if any do.
95
+ */
96
+ expectNone(match, description) {
97
+ description = description || this.descriptionFromMatcher(match);
98
+ const matches = this.match(match);
99
+ if (matches.length > 0) {
100
+ throw new Error(`Expected zero matching requests for criteria "${description}", found ${matches.length}.`);
101
+ }
102
+ }
103
+ /**
104
+ * Validate that there are no outstanding requests.
105
+ */
106
+ verify(opts = {}) {
107
+ let open = this.open;
108
+ // It's possible that some requests may be cancelled, and this is expected.
109
+ // The user can ask to ignore open requests which have been cancelled.
110
+ if (opts.ignoreCancelled) {
111
+ open = open.filter(testReq => !testReq.cancelled);
112
+ }
113
+ if (open.length > 0) {
114
+ // Show the methods and URLs of open requests in the error, for convenience.
115
+ const requests = open.map(testReq => {
116
+ const url = testReq.request.urlWithParams.split('?')[0];
117
+ const method = testReq.request.method;
118
+ return `${method} ${url}`;
119
+ })
120
+ .join(', ');
121
+ throw new Error(`Expected no open requests, found ${open.length}: ${requests}`);
122
+ }
123
+ }
124
+ descriptionFromMatcher(matcher) {
125
+ if (typeof matcher === 'string') {
126
+ return `Match URL: ${matcher}`;
127
+ }
128
+ else if (typeof matcher === 'object') {
129
+ const method = matcher.method || '(any)';
130
+ const url = matcher.url || '(any)';
131
+ return `Match method: ${method}, URL: ${url}`;
132
+ }
133
+ else {
134
+ return `Match by function: ${matcher.name}`;
135
+ }
136
+ }
137
+ };
138
+ exports.HttpClientTestingBackend = HttpClientTestingBackend;
139
+ exports.HttpClientTestingBackend = HttpClientTestingBackend = tslib_1.__decorate([
140
+ (0, di_1.Injectable)()
141
+ ], HttpClientTestingBackend);
142
142
  //# sourceMappingURL=backend.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"backend.js","sourceRoot":"","sources":["../../src/testing/backend.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,0CAAqD;AAGrD,qCAAwC;AACxC,+BAA0C;AAG1C,uCAAsC;AAGt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AAsB,CAAC,OACoC;QACjE,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAChC,OAAO,cAAc,OAAO,EAAE,CAAC;QACjC,CAAC;aAAM,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YACvC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC;YACzC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC;YACnC,OAAO,iBAAiB,MAAM,UAAU,GAAG,EAAE,CAAC;QAChD,CAAC;aAAM,CAAC;YACN,OAAO,sBAAsB,OAAO,CAAC,IAAI,EAAE,CAAC;QAC9C,CAAC;IACH,CAAC;CACF,CAAA;AArHY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,eAAU,GAAE;GACA,wBAAwB,CAqHpC"}
@@ -1,11 +1,11 @@
1
- /**
2
- * @license
3
- * Copyright Google Inc. All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- export { HttpTestingController, RequestMatch } from './api';
9
- export { HttpClientTestingModule } from './module';
10
- export { TestRequest } from './request';
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ export { HttpTestingController, RequestMatch } from './api';
9
+ export { HttpClientTestingModule } from './module';
10
+ export { TestRequest } from './request';
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1,17 +1,17 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google Inc. All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.TestRequest = exports.HttpClientTestingModule = exports.HttpTestingController = void 0;
11
- var api_1 = require("./api");
12
- Object.defineProperty(exports, "HttpTestingController", { enumerable: true, get: function () { return api_1.HttpTestingController; } });
13
- var module_1 = require("./module");
14
- Object.defineProperty(exports, "HttpClientTestingModule", { enumerable: true, get: function () { return module_1.HttpClientTestingModule; } });
15
- var request_1 = require("./request");
16
- Object.defineProperty(exports, "TestRequest", { enumerable: true, get: function () { return request_1.TestRequest; } });
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google Inc. All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.TestRequest = exports.HttpClientTestingModule = exports.HttpTestingController = void 0;
11
+ var api_1 = require("./api");
12
+ Object.defineProperty(exports, "HttpTestingController", { enumerable: true, get: function () { return api_1.HttpTestingController; } });
13
+ var module_1 = require("./module");
14
+ Object.defineProperty(exports, "HttpClientTestingModule", { enumerable: true, get: function () { return module_1.HttpClientTestingModule; } });
15
+ var request_1 = require("./request");
16
+ Object.defineProperty(exports, "TestRequest", { enumerable: true, get: function () { return request_1.TestRequest; } });
17
17
  //# sourceMappingURL=index.js.map
@@ -1,17 +1,17 @@
1
- /**
2
- * @license
3
- * Copyright Google Inc. All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- /**
9
- * Configures `HttpClientTestingBackend` as the `HttpBackend` used by `HttpClient`.
10
- *
11
- * Inject `HttpTestingController` to expect and flush requests in your tests.
12
- *
13
- *
14
- */
15
- export declare class HttpClientTestingModule {
16
- }
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ /**
9
+ * Configures `HttpClientTestingBackend` as the `HttpBackend` used by `HttpClient`.
10
+ *
11
+ * Inject `HttpTestingController` to expect and flush requests in your tests.
12
+ *
13
+ *
14
+ */
15
+ export declare class HttpClientTestingModule {
16
+ }
17
17
  //# sourceMappingURL=module.d.ts.map
@@ -1,39 +1,39 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google Inc. All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.HttpClientTestingModule = void 0;
11
- const tslib_1 = require("tslib");
12
- const backend_1 = require("../backend");
13
- const module_1 = require("../module");
14
- const di_1 = require("@alterior/di");
15
- const api_1 = require("./api");
16
- const backend_2 = require("./backend");
17
- /**
18
- * Configures `HttpClientTestingBackend` as the `HttpBackend` used by `HttpClient`.
19
- *
20
- * Inject `HttpTestingController` to expect and flush requests in your tests.
21
- *
22
- *
23
- */
24
- let HttpClientTestingModule = class HttpClientTestingModule {
25
- };
26
- HttpClientTestingModule = tslib_1.__decorate([
27
- (0, di_1.Module)({
28
- imports: [
29
- module_1.HttpClientModule,
30
- ],
31
- providers: [
32
- backend_2.HttpClientTestingBackend,
33
- { provide: backend_1.HttpBackend, useExisting: backend_2.HttpClientTestingBackend },
34
- { provide: api_1.HttpTestingController, useExisting: backend_2.HttpClientTestingBackend },
35
- ],
36
- })
37
- ], HttpClientTestingModule);
38
- exports.HttpClientTestingModule = HttpClientTestingModule;
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google Inc. All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.HttpClientTestingModule = void 0;
11
+ const tslib_1 = require("tslib");
12
+ const backend_1 = require("../backend");
13
+ const module_1 = require("../module");
14
+ const di_1 = require("@alterior/di");
15
+ const api_1 = require("./api");
16
+ const backend_2 = require("./backend");
17
+ /**
18
+ * Configures `HttpClientTestingBackend` as the `HttpBackend` used by `HttpClient`.
19
+ *
20
+ * Inject `HttpTestingController` to expect and flush requests in your tests.
21
+ *
22
+ *
23
+ */
24
+ let HttpClientTestingModule = class HttpClientTestingModule {
25
+ };
26
+ exports.HttpClientTestingModule = HttpClientTestingModule;
27
+ exports.HttpClientTestingModule = HttpClientTestingModule = tslib_1.__decorate([
28
+ (0, di_1.Module)({
29
+ imports: [
30
+ module_1.HttpClientModule,
31
+ ],
32
+ providers: [
33
+ backend_2.HttpClientTestingBackend,
34
+ { provide: backend_1.HttpBackend, useExisting: backend_2.HttpClientTestingBackend },
35
+ { provide: api_1.HttpTestingController, useExisting: backend_2.HttpClientTestingBackend },
36
+ ],
37
+ })
38
+ ], HttpClientTestingModule);
39
39
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/testing/module.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,wCAAuC;AACvC,sCAA2C;AAC3C,qCAAoC;AAEpC,+BAA4C;AAC5C,uCAAmD;AAGnD;;;;;;GAMG;AAWI,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CACnC,CAAA;AADY,uBAAuB;IAVnC,IAAA,WAAM,EAAC;QACN,OAAO,EAAE;YACP,yBAAgB;SACjB;QACD,SAAS,EAAE;YACT,kCAAwB;YACxB,EAAC,OAAO,EAAE,qBAAW,EAAE,WAAW,EAAE,kCAAwB,EAAC;YAC7D,EAAC,OAAO,EAAE,2BAAqB,EAAE,WAAW,EAAE,kCAAwB,EAAC;SACxE;KACF,CAAC;GACW,uBAAuB,CACnC;AADY,0DAAuB"}
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/testing/module.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,wCAAuC;AACvC,sCAA2C;AAC3C,qCAAoC;AAEpC,+BAA4C;AAC5C,uCAAmD;AAGnD;;;;;;GAMG;AAWI,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CACnC,CAAA;AADY,0DAAuB;kCAAvB,uBAAuB;IAVnC,IAAA,WAAM,EAAC;QACN,OAAO,EAAE;YACP,yBAAgB;SACjB;QACD,SAAS,EAAE;YACT,kCAAwB;YACxB,EAAC,OAAO,EAAE,qBAAW,EAAE,WAAW,EAAE,kCAAwB,EAAC;YAC7D,EAAC,OAAO,EAAE,2BAAqB,EAAE,WAAW,EAAE,kCAAwB,EAAC;SACxE;KACF,CAAC;GACW,uBAAuB,CACnC"}
@@ -1,57 +1,57 @@
1
- /**
2
- * @license
3
- * Copyright Google Inc. All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- import { Observer } from 'rxjs';
9
- import { HttpRequest } from '../request';
10
- import { HttpEvent } from '../response';
11
- import { HttpHeaders } from '../headers';
12
- /**
13
- * A mock requests that was received and is ready to be answered.
14
- *
15
- * This interface allows access to the underlying `HttpRequest`, and allows
16
- * responding with `HttpEvent`s or `HttpErrorResponse`s.
17
- *
18
- *
19
- */
20
- export declare class TestRequest {
21
- request: HttpRequest<any>;
22
- private observer;
23
- /**
24
- * Whether the request was cancelled after it was sent.
25
- */
26
- get cancelled(): boolean;
27
- constructor(request: HttpRequest<any>, observer: Observer<HttpEvent<any>>);
28
- /**
29
- * Resolve the request by returning a body plus additional HTTP information (such as response
30
- * headers) if provided.
31
- *
32
- * Both successful and unsuccessful responses can be delivered via `flush()`.
33
- */
34
- flush(body: ArrayBuffer | Blob | string | number | Object | (string | number | Object | null)[] | null, opts?: {
35
- headers?: HttpHeaders | {
36
- [name: string]: string | string[];
37
- };
38
- status?: number;
39
- statusText?: string;
40
- }): void;
41
- /**
42
- * Resolve the request by returning an `ErrorEvent` (e.g. simulating a network failure).
43
- */
44
- error(error: ErrorEvent, opts?: {
45
- headers?: HttpHeaders | {
46
- [name: string]: string | string[];
47
- };
48
- status?: number;
49
- statusText?: string;
50
- }): void;
51
- /**
52
- * Deliver an arbitrary `HttpEvent` (such as a progress event) on the response stream for this
53
- * request.
54
- */
55
- event(event: HttpEvent<any>): void;
56
- }
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import { Observer } from 'rxjs';
9
+ import { HttpRequest } from '../request';
10
+ import { HttpEvent } from '../response';
11
+ import { HttpHeaders } from '../headers';
12
+ /**
13
+ * A mock requests that was received and is ready to be answered.
14
+ *
15
+ * This interface allows access to the underlying `HttpRequest`, and allows
16
+ * responding with `HttpEvent`s or `HttpErrorResponse`s.
17
+ *
18
+ *
19
+ */
20
+ export declare class TestRequest {
21
+ request: HttpRequest<any>;
22
+ private observer;
23
+ /**
24
+ * Whether the request was cancelled after it was sent.
25
+ */
26
+ get cancelled(): boolean;
27
+ constructor(request: HttpRequest<any>, observer: Observer<HttpEvent<any>>);
28
+ /**
29
+ * Resolve the request by returning a body plus additional HTTP information (such as response
30
+ * headers) if provided.
31
+ *
32
+ * Both successful and unsuccessful responses can be delivered via `flush()`.
33
+ */
34
+ flush(body: ArrayBuffer | Blob | string | number | Object | (string | number | Object | null)[] | null, opts?: {
35
+ headers?: HttpHeaders | {
36
+ [name: string]: string | string[];
37
+ };
38
+ status?: number;
39
+ statusText?: string;
40
+ }): void;
41
+ /**
42
+ * Resolve the request by returning an `ErrorEvent` (e.g. simulating a network failure).
43
+ */
44
+ error(error: ErrorEvent, opts?: {
45
+ headers?: HttpHeaders | {
46
+ [name: string]: string | string[];
47
+ };
48
+ status?: number;
49
+ statusText?: string;
50
+ }): void;
51
+ /**
52
+ * Deliver an arbitrary `HttpEvent` (such as a progress event) on the response stream for this
53
+ * request.
54
+ */
55
+ event(event: HttpEvent<any>): void;
56
+ }
57
57
  //# sourceMappingURL=request.d.ts.map