@ama-sdk/client-fetch 12.3.0-prerelease.9 → 12.4.0-prerelease.0
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.
- package/cjs/api-fetch-client.js +18 -22
- package/cjs/plugins/abort/abort.spec.js +83 -81
- package/cjs/plugins/concurrent/concurrent.fetch.js +12 -20
- package/cjs/plugins/concurrent/concurrent.spec.js +99 -99
- package/cjs/plugins/keepalive/keepalive.request.js +7 -12
- package/cjs/plugins/keepalive/keepalive.spec.js +32 -34
- package/cjs/plugins/mock-intercept/mock-intercept.fetch.js +15 -22
- package/cjs/plugins/mock-intercept/mock-intercept.spec.js +247 -239
- package/cjs/plugins/perf-metric/perf-metric.fetch.js +11 -18
- package/cjs/plugins/retry/retry.fetch.js +18 -27
- package/cjs/plugins/retry/retry.spec.js +233 -225
- package/cjs/plugins/timeout/timeout.fetch.js +13 -19
- package/cjs/plugins/timeout/timeout.spec.js +211 -205
- package/cjs/plugins/wait-for/wait-for.fetch.js +19 -29
- package/cjs/plugins/wait-for/wait-for.spec.js +211 -203
- package/esm2015/api-fetch-client.js +18 -22
- package/esm2015/plugins/abort/abort.spec.js +83 -81
- package/esm2015/plugins/concurrent/concurrent.fetch.js +12 -20
- package/esm2015/plugins/concurrent/concurrent.spec.js +99 -99
- package/esm2015/plugins/keepalive/keepalive.request.js +7 -12
- package/esm2015/plugins/keepalive/keepalive.spec.js +32 -34
- package/esm2015/plugins/mock-intercept/mock-intercept.fetch.js +15 -22
- package/esm2015/plugins/mock-intercept/mock-intercept.spec.js +247 -239
- package/esm2015/plugins/perf-metric/perf-metric.fetch.js +11 -18
- package/esm2015/plugins/retry/retry.fetch.js +18 -27
- package/esm2015/plugins/retry/retry.spec.js +233 -225
- package/esm2015/plugins/timeout/timeout.fetch.js +13 -19
- package/esm2015/plugins/timeout/timeout.spec.js +211 -205
- package/esm2015/plugins/wait-for/wait-for.fetch.js +19 -29
- package/esm2015/plugins/wait-for/wait-for.spec.js +211 -203
- package/package.json +15 -15
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +11 -21
- package/src/api-fetch-client.d.ts +1 -1
- package/src/api-fetch-client.d.ts.map +1 -1
- package/src/api-fetch-client.js +2 -1
- package/src/api-fetch-client.js.map +1 -1
|
@@ -109,7 +109,7 @@ function _object_spread_props(target, source) {
|
|
|
109
109
|
return target;
|
|
110
110
|
}
|
|
111
111
|
function _ts_generator(thisArg, body) {
|
|
112
|
-
var f, y, t,
|
|
112
|
+
var f, y, t, _ = {
|
|
113
113
|
label: 0,
|
|
114
114
|
sent: function() {
|
|
115
115
|
if (t[0] & 1) throw t[1];
|
|
@@ -117,12 +117,8 @@ function _ts_generator(thisArg, body) {
|
|
|
117
117
|
},
|
|
118
118
|
trys: [],
|
|
119
119
|
ops: []
|
|
120
|
-
};
|
|
121
|
-
return g = {
|
|
122
|
-
next: verb(0),
|
|
123
|
-
"throw": verb(1),
|
|
124
|
-
"return": verb(2)
|
|
125
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
120
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
121
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
126
122
|
return this;
|
|
127
123
|
}), g;
|
|
128
124
|
function verb(n) {
|
|
@@ -135,7 +131,7 @@ function _ts_generator(thisArg, body) {
|
|
|
135
131
|
}
|
|
136
132
|
function step(op) {
|
|
137
133
|
if (f) throw new TypeError("Generator is already executing.");
|
|
138
|
-
while(_)try {
|
|
134
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
139
135
|
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;
|
|
140
136
|
if (y = 0, t) op = [
|
|
141
137
|
op[0] & 2,
|
|
@@ -218,23 +214,23 @@ var WaitForFetch = /*#__PURE__*/ function() {
|
|
|
218
214
|
{
|
|
219
215
|
key: "load",
|
|
220
216
|
value: /** @inheritDoc */ function load(context) {
|
|
221
|
-
var data;
|
|
222
217
|
var _this = this;
|
|
218
|
+
var data;
|
|
223
219
|
return {
|
|
224
220
|
// eslint-disable-next-line no-async-promise-executor -- all await are handled with a try-catch block
|
|
225
221
|
canStart: function() {
|
|
226
|
-
return new Promise(
|
|
227
|
-
|
|
222
|
+
return new Promise(function(resolve) {
|
|
223
|
+
return _async_to_generator(function() {
|
|
228
224
|
var didTimeOut, timer, canStartCondition, canStart, e;
|
|
229
225
|
return _ts_generator(this, function(_state) {
|
|
230
226
|
switch(_state.label){
|
|
231
227
|
case 0:
|
|
232
228
|
didTimeOut = false;
|
|
233
|
-
if (
|
|
229
|
+
if (this.timeout) {
|
|
234
230
|
timer = setTimeout(function() {
|
|
235
231
|
didTimeOut = true;
|
|
236
232
|
resolve(false);
|
|
237
|
-
},
|
|
233
|
+
}, this.timeout);
|
|
238
234
|
}
|
|
239
235
|
_state.label = 1;
|
|
240
236
|
case 1:
|
|
@@ -246,7 +242,7 @@ var WaitForFetch = /*#__PURE__*/ function() {
|
|
|
246
242
|
]);
|
|
247
243
|
return [
|
|
248
244
|
4,
|
|
249
|
-
|
|
245
|
+
this.canStartCondition(context)
|
|
250
246
|
];
|
|
251
247
|
case 2:
|
|
252
248
|
canStartCondition = _state.sent();
|
|
@@ -286,19 +282,16 @@ var WaitForFetch = /*#__PURE__*/ function() {
|
|
|
286
282
|
];
|
|
287
283
|
}
|
|
288
284
|
});
|
|
289
|
-
});
|
|
290
|
-
|
|
291
|
-
return _ref.apply(this, arguments);
|
|
292
|
-
};
|
|
293
|
-
}());
|
|
285
|
+
}).call(_this);
|
|
286
|
+
});
|
|
294
287
|
},
|
|
295
|
-
transform:
|
|
296
|
-
|
|
288
|
+
transform: function(fetchCall) {
|
|
289
|
+
return _async_to_generator(function() {
|
|
297
290
|
var response, e;
|
|
298
291
|
return _ts_generator(this, function(_state) {
|
|
299
292
|
switch(_state.label){
|
|
300
293
|
case 0:
|
|
301
|
-
if (!
|
|
294
|
+
if (!this.callback) {
|
|
302
295
|
return [
|
|
303
296
|
2,
|
|
304
297
|
fetchCall
|
|
@@ -318,7 +311,7 @@ var WaitForFetch = /*#__PURE__*/ function() {
|
|
|
318
311
|
];
|
|
319
312
|
case 2:
|
|
320
313
|
response = _state.sent();
|
|
321
|
-
|
|
314
|
+
this.callback(_object_spread_props(_object_spread({}, context), {
|
|
322
315
|
data: data
|
|
323
316
|
}), fetchCall, response);
|
|
324
317
|
return [
|
|
@@ -327,7 +320,7 @@ var WaitForFetch = /*#__PURE__*/ function() {
|
|
|
327
320
|
];
|
|
328
321
|
case 3:
|
|
329
322
|
e = _state.sent();
|
|
330
|
-
|
|
323
|
+
this.callback(_object_spread_props(_object_spread({}, context), {
|
|
331
324
|
data: data
|
|
332
325
|
}), fetchCall, response);
|
|
333
326
|
throw e;
|
|
@@ -337,11 +330,8 @@ var WaitForFetch = /*#__PURE__*/ function() {
|
|
|
337
330
|
];
|
|
338
331
|
}
|
|
339
332
|
});
|
|
340
|
-
});
|
|
341
|
-
|
|
342
|
-
return _ref.apply(this, arguments);
|
|
343
|
-
};
|
|
344
|
-
}()
|
|
333
|
+
}).call(_this);
|
|
334
|
+
}
|
|
345
335
|
};
|
|
346
336
|
}
|
|
347
337
|
}
|
|
@@ -85,7 +85,7 @@ function _object_spread_props(target, source) {
|
|
|
85
85
|
return target;
|
|
86
86
|
}
|
|
87
87
|
function _ts_generator(thisArg, body) {
|
|
88
|
-
var f, y, t,
|
|
88
|
+
var f, y, t, _ = {
|
|
89
89
|
label: 0,
|
|
90
90
|
sent: function() {
|
|
91
91
|
if (t[0] & 1) throw t[1];
|
|
@@ -93,12 +93,8 @@ function _ts_generator(thisArg, body) {
|
|
|
93
93
|
},
|
|
94
94
|
trys: [],
|
|
95
95
|
ops: []
|
|
96
|
-
};
|
|
97
|
-
return g = {
|
|
98
|
-
next: verb(0),
|
|
99
|
-
"throw": verb(1),
|
|
100
|
-
"return": verb(2)
|
|
101
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
96
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
97
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
102
98
|
return this;
|
|
103
99
|
}), g;
|
|
104
100
|
function verb(n) {
|
|
@@ -111,7 +107,7 @@ function _ts_generator(thisArg, body) {
|
|
|
111
107
|
}
|
|
112
108
|
function step(op) {
|
|
113
109
|
if (f) throw new TypeError("Generator is already executing.");
|
|
114
|
-
while(_)try {
|
|
110
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
115
111
|
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;
|
|
116
112
|
if (y = 0, t) op = [
|
|
117
113
|
op[0] & 2,
|
|
@@ -181,203 +177,215 @@ function _ts_generator(thisArg, body) {
|
|
|
181
177
|
}
|
|
182
178
|
describe('Wait For Fetch Plugin', function() {
|
|
183
179
|
var defaultContext = {};
|
|
184
|
-
it('should not start if timeout',
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
return
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
runner.
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
180
|
+
it('should not start if timeout', function() {
|
|
181
|
+
return _async_to_generator(function() {
|
|
182
|
+
var plugin, runner, canStart;
|
|
183
|
+
return _ts_generator(this, function(_state) {
|
|
184
|
+
switch(_state.label){
|
|
185
|
+
case 0:
|
|
186
|
+
plugin = new _waitforfetch.WaitForFetch(function() {
|
|
187
|
+
return {
|
|
188
|
+
result: new Promise(function(resolve) {
|
|
189
|
+
return setTimeout(function() {
|
|
190
|
+
return resolve(true);
|
|
191
|
+
}, 2000);
|
|
192
|
+
})
|
|
193
|
+
};
|
|
194
|
+
}, 100);
|
|
195
|
+
runner = plugin.load(defaultContext);
|
|
196
|
+
canStart = runner.canStart();
|
|
197
|
+
return [
|
|
198
|
+
4,
|
|
199
|
+
jest.runAllTimersAsync()
|
|
200
|
+
];
|
|
201
|
+
case 1:
|
|
202
|
+
_state.sent();
|
|
203
|
+
return [
|
|
204
|
+
4,
|
|
205
|
+
canStart
|
|
206
|
+
];
|
|
207
|
+
case 2:
|
|
208
|
+
expect.apply(void 0, [
|
|
209
|
+
_state.sent()
|
|
210
|
+
]).toBe(false);
|
|
211
|
+
return [
|
|
212
|
+
2
|
|
213
|
+
];
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
})();
|
|
217
|
+
});
|
|
218
|
+
it('should start if promise condition passed', function() {
|
|
219
|
+
return _async_to_generator(function() {
|
|
220
|
+
var plugin, runner, canStart;
|
|
221
|
+
return _ts_generator(this, function(_state) {
|
|
222
|
+
switch(_state.label){
|
|
223
|
+
case 0:
|
|
224
|
+
plugin = new _waitforfetch.WaitForFetch(function() {
|
|
225
|
+
return {
|
|
226
|
+
result: Promise.resolve(true)
|
|
227
|
+
};
|
|
228
|
+
}, 100);
|
|
229
|
+
runner = plugin.load(defaultContext);
|
|
230
|
+
return [
|
|
231
|
+
4,
|
|
232
|
+
runner.canStart()
|
|
233
|
+
];
|
|
234
|
+
case 1:
|
|
235
|
+
canStart = _state.sent();
|
|
236
|
+
expect(canStart).toBe(true);
|
|
237
|
+
return [
|
|
238
|
+
2
|
|
239
|
+
];
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
})();
|
|
243
|
+
});
|
|
244
|
+
it('should start if condition passed', function() {
|
|
245
|
+
return _async_to_generator(function() {
|
|
246
|
+
var plugin, runner, canStart;
|
|
247
|
+
return _ts_generator(this, function(_state) {
|
|
248
|
+
switch(_state.label){
|
|
249
|
+
case 0:
|
|
250
|
+
plugin = new _waitforfetch.WaitForFetch(function() {
|
|
251
|
+
return {
|
|
252
|
+
result: true
|
|
253
|
+
};
|
|
254
|
+
}, 100);
|
|
255
|
+
runner = plugin.load(defaultContext);
|
|
256
|
+
return [
|
|
257
|
+
4,
|
|
258
|
+
runner.canStart()
|
|
259
|
+
];
|
|
260
|
+
case 1:
|
|
261
|
+
canStart = _state.sent();
|
|
262
|
+
expect(canStart).toBe(true);
|
|
263
|
+
return [
|
|
264
|
+
2
|
|
265
|
+
];
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
})();
|
|
269
|
+
});
|
|
270
|
+
it('should call the callback function on success', function() {
|
|
271
|
+
return _async_to_generator(function() {
|
|
272
|
+
var callback, plugin, runner, response, fetchCall;
|
|
273
|
+
return _ts_generator(this, function(_state) {
|
|
274
|
+
switch(_state.label){
|
|
275
|
+
case 0:
|
|
276
|
+
callback = jest.fn();
|
|
277
|
+
plugin = new _waitforfetch.WaitForFetch(function() {
|
|
278
|
+
return {
|
|
279
|
+
result: true
|
|
280
|
+
};
|
|
281
|
+
}, 100, callback);
|
|
282
|
+
runner = plugin.load(defaultContext);
|
|
283
|
+
response = {
|
|
284
|
+
test: true
|
|
252
285
|
};
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
})
|
|
268
|
-
it('should call the callback function
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
286
|
+
fetchCall = Promise.resolve(response);
|
|
287
|
+
return [
|
|
288
|
+
4,
|
|
289
|
+
runner.transform(fetchCall)
|
|
290
|
+
];
|
|
291
|
+
case 1:
|
|
292
|
+
_state.sent();
|
|
293
|
+
expect(callback).toHaveBeenCalledWith(expect.objectContaining(defaultContext), fetchCall, response);
|
|
294
|
+
return [
|
|
295
|
+
2
|
|
296
|
+
];
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
})();
|
|
300
|
+
});
|
|
301
|
+
it('should call the callback function with the correct data', function() {
|
|
302
|
+
return _async_to_generator(function() {
|
|
303
|
+
var callback, plugin, runner, response, fetchCall;
|
|
304
|
+
return _ts_generator(this, function(_state) {
|
|
305
|
+
switch(_state.label){
|
|
306
|
+
case 0:
|
|
307
|
+
callback = jest.fn();
|
|
308
|
+
plugin = new _waitforfetch.WaitForFetch(function() {
|
|
309
|
+
return {
|
|
310
|
+
result: true,
|
|
311
|
+
data: 'test'
|
|
312
|
+
};
|
|
313
|
+
}, 100, callback);
|
|
314
|
+
runner = plugin.load(defaultContext);
|
|
315
|
+
response = {
|
|
316
|
+
test: true
|
|
277
317
|
};
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
2
|
|
293
|
-
];
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
}));
|
|
297
|
-
it('should call the callback function with the correct data', /*#__PURE__*/ _async_to_generator(function() {
|
|
298
|
-
var callback, plugin, runner, response, fetchCall;
|
|
299
|
-
return _ts_generator(this, function(_state) {
|
|
300
|
-
switch(_state.label){
|
|
301
|
-
case 0:
|
|
302
|
-
callback = jest.fn();
|
|
303
|
-
plugin = new _waitforfetch.WaitForFetch(function() {
|
|
304
|
-
return {
|
|
305
|
-
result: true,
|
|
318
|
+
fetchCall = Promise.resolve(response);
|
|
319
|
+
return [
|
|
320
|
+
4,
|
|
321
|
+
runner.canStart()
|
|
322
|
+
];
|
|
323
|
+
case 1:
|
|
324
|
+
_state.sent();
|
|
325
|
+
return [
|
|
326
|
+
4,
|
|
327
|
+
runner.transform(fetchCall)
|
|
328
|
+
];
|
|
329
|
+
case 2:
|
|
330
|
+
_state.sent();
|
|
331
|
+
expect(callback).toHaveBeenCalledWith(expect.objectContaining(_object_spread_props(_object_spread({}, defaultContext), {
|
|
306
332
|
data: 'test'
|
|
333
|
+
})), fetchCall, response);
|
|
334
|
+
return [
|
|
335
|
+
2
|
|
336
|
+
];
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
})();
|
|
340
|
+
});
|
|
341
|
+
it('should call the callback function on failure', function() {
|
|
342
|
+
return _async_to_generator(function() {
|
|
343
|
+
var callback, plugin, runner, response, fetchCall, e;
|
|
344
|
+
return _ts_generator(this, function(_state) {
|
|
345
|
+
switch(_state.label){
|
|
346
|
+
case 0:
|
|
347
|
+
callback = jest.fn();
|
|
348
|
+
plugin = new _waitforfetch.WaitForFetch(function() {
|
|
349
|
+
return {
|
|
350
|
+
result: true
|
|
351
|
+
};
|
|
352
|
+
}, 100, callback);
|
|
353
|
+
runner = plugin.load(defaultContext);
|
|
354
|
+
response = {
|
|
355
|
+
test: true
|
|
307
356
|
};
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
return {
|
|
343
|
-
result: true
|
|
344
|
-
};
|
|
345
|
-
}, 100, callback);
|
|
346
|
-
runner = plugin.load(defaultContext);
|
|
347
|
-
response = {
|
|
348
|
-
test: true
|
|
349
|
-
};
|
|
350
|
-
fetchCall = Promise.reject(new Error(JSON.stringify(response)));
|
|
351
|
-
_state.label = 1;
|
|
352
|
-
case 1:
|
|
353
|
-
_state.trys.push([
|
|
354
|
-
1,
|
|
355
|
-
3,
|
|
356
|
-
,
|
|
357
|
-
4
|
|
358
|
-
]);
|
|
359
|
-
return [
|
|
360
|
-
4,
|
|
361
|
-
runner.transform(fetchCall)
|
|
362
|
-
];
|
|
363
|
-
case 2:
|
|
364
|
-
_state.sent();
|
|
365
|
-
return [
|
|
366
|
-
3,
|
|
367
|
-
4
|
|
368
|
-
];
|
|
369
|
-
case 3:
|
|
370
|
-
e = _state.sent();
|
|
371
|
-
return [
|
|
372
|
-
3,
|
|
373
|
-
4
|
|
374
|
-
];
|
|
375
|
-
case 4:
|
|
376
|
-
expect(callback).toHaveBeenCalledWith(expect.objectContaining(defaultContext), fetchCall, undefined);
|
|
377
|
-
return [
|
|
378
|
-
2
|
|
379
|
-
];
|
|
380
|
-
}
|
|
381
|
-
});
|
|
382
|
-
}));
|
|
357
|
+
fetchCall = Promise.reject(new Error(JSON.stringify(response)));
|
|
358
|
+
_state.label = 1;
|
|
359
|
+
case 1:
|
|
360
|
+
_state.trys.push([
|
|
361
|
+
1,
|
|
362
|
+
3,
|
|
363
|
+
,
|
|
364
|
+
4
|
|
365
|
+
]);
|
|
366
|
+
return [
|
|
367
|
+
4,
|
|
368
|
+
runner.transform(fetchCall)
|
|
369
|
+
];
|
|
370
|
+
case 2:
|
|
371
|
+
_state.sent();
|
|
372
|
+
return [
|
|
373
|
+
3,
|
|
374
|
+
4
|
|
375
|
+
];
|
|
376
|
+
case 3:
|
|
377
|
+
e = _state.sent();
|
|
378
|
+
return [
|
|
379
|
+
3,
|
|
380
|
+
4
|
|
381
|
+
];
|
|
382
|
+
case 4:
|
|
383
|
+
expect(callback).toHaveBeenCalledWith(expect.objectContaining(defaultContext), fetchCall, undefined);
|
|
384
|
+
return [
|
|
385
|
+
2
|
|
386
|
+
];
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
})();
|
|
390
|
+
});
|
|
383
391
|
});
|