@khanacademy/wonder-blocks-testing 7.0.5 → 7.1.2
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/CHANGELOG.md +24 -0
- package/dist/es/index.js +160 -62
- package/dist/index.js +401 -191
- package/package.json +2 -2
- package/src/__docs__/exports.respond-with.stories.mdx +17 -6
- package/src/__docs__/exports.settle-controller.stories.mdx +32 -0
- package/src/__docs__/types.mock-response.stories.mdx +6 -2
- package/src/__tests__/mock-requester.test.js +4 -4
- package/src/__tests__/respond-with.test.js +525 -0
- package/src/__tests__/settle-controller.test.js +29 -0
- package/src/__tests__/settle-signal.test.js +105 -0
- package/src/fetch/__tests__/__snapshots__/mock-fetch.test.js.snap +8 -8
- package/src/fetch/__tests__/fetch-request-matches-mock.test.js +1 -1
- package/src/fetch/__tests__/mock-fetch.test.js +1 -1
- package/src/fetch/types.js +1 -1
- package/src/gql/__tests__/mock-gql-fetch.test.js +10 -10
- package/src/gql/__tests__/wb-data-integration.test.js +1 -1
- package/src/gql/types.js +1 -1
- package/src/index.js +3 -2
- package/src/mock-requester.js +2 -3
- package/src/respond-with.js +236 -0
- package/src/settle-controller.js +35 -0
- package/src/settle-signal.js +41 -0
- package/src/types.js +1 -1
- package/src/__tests__/make-mock-response.test.js +0 -460
- package/src/make-mock-response.js +0 -150
package/dist/index.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 28);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ([
|
|
@@ -93,16 +93,30 @@ module.exports = require("react");
|
|
|
93
93
|
|
|
94
94
|
/***/ }),
|
|
95
95
|
/* 1 */
|
|
96
|
+
/***/ (function(module, exports) {
|
|
97
|
+
|
|
98
|
+
function _classPrivateFieldBase(receiver, privateKey) {
|
|
99
|
+
if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {
|
|
100
|
+
throw new TypeError("attempted to use private field on non-instance");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return receiver;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
module.exports = _classPrivateFieldBase, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
107
|
+
|
|
108
|
+
/***/ }),
|
|
109
|
+
/* 2 */
|
|
96
110
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
97
111
|
|
|
98
112
|
"use strict";
|
|
99
113
|
__webpack_require__.r(__webpack_exports__);
|
|
100
114
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultAdapters", function() { return DefaultAdapters; });
|
|
101
115
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultConfigs", function() { return DefaultConfigs; });
|
|
102
|
-
/* harmony import */ var _css_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
103
|
-
/* harmony import */ var _data_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
104
|
-
/* harmony import */ var _portal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
105
|
-
/* harmony import */ var _router_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
116
|
+
/* harmony import */ var _css_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10);
|
|
117
|
+
/* harmony import */ var _data_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11);
|
|
118
|
+
/* harmony import */ var _portal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12);
|
|
119
|
+
/* harmony import */ var _router_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13);
|
|
106
120
|
|
|
107
121
|
|
|
108
122
|
|
|
@@ -135,21 +149,22 @@ const DefaultConfigs = {
|
|
|
135
149
|
};
|
|
136
150
|
|
|
137
151
|
/***/ }),
|
|
138
|
-
/*
|
|
152
|
+
/* 3 */
|
|
139
153
|
/***/ (function(module, exports) {
|
|
140
154
|
|
|
141
155
|
module.exports = require("react-router-dom");
|
|
142
156
|
|
|
143
157
|
/***/ }),
|
|
144
|
-
/*
|
|
158
|
+
/* 4 */
|
|
145
159
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
146
160
|
|
|
147
161
|
"use strict";
|
|
148
162
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return makeTestHarness; });
|
|
149
|
-
/* harmony import */ var
|
|
150
|
-
/* harmony import */ var
|
|
151
|
-
/* harmony import */ var
|
|
152
|
-
|
|
163
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26);
|
|
164
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
|
|
165
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
|
166
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
167
|
+
/* harmony import */ var _render_adapters_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27);
|
|
153
168
|
|
|
154
169
|
|
|
155
170
|
|
|
@@ -188,7 +203,7 @@ const makeTestHarness = (adapters, defaultConfigs) => {
|
|
|
188
203
|
const fullConfig = { ...defaultConfigs,
|
|
189
204
|
...configs
|
|
190
205
|
};
|
|
191
|
-
const harnessedComponent = /*#__PURE__*/
|
|
206
|
+
const harnessedComponent = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["forwardRef"]((props, ref) => Object(_render_adapters_js__WEBPACK_IMPORTED_MODULE_2__[/* renderAdapters */ "a"])(adapters, fullConfig, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](Component, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, props, {
|
|
192
207
|
ref: ref
|
|
193
208
|
})))); // We add a name for the component here so that we can detect that
|
|
194
209
|
// later and also see it in traces and what have you.
|
|
@@ -199,134 +214,26 @@ const makeTestHarness = (adapters, defaultConfigs) => {
|
|
|
199
214
|
};
|
|
200
215
|
|
|
201
216
|
/***/ }),
|
|
202
|
-
/*
|
|
203
|
-
/***/ (function(module,
|
|
204
|
-
|
|
205
|
-
"use strict";
|
|
206
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RespondWith; });
|
|
207
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return makeMockResponse; });
|
|
208
|
-
/* harmony import */ var _response_impl_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19);
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* Helper for creating a text-based mock response.
|
|
213
|
-
*/
|
|
214
|
-
const textResponse = (text, statusCode = 200) => ({
|
|
215
|
-
type: "text",
|
|
216
|
-
text,
|
|
217
|
-
statusCode
|
|
218
|
-
});
|
|
219
|
-
/**
|
|
220
|
-
* Helper for creating a rejected mock response.
|
|
221
|
-
*/
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
const rejectResponse = error => ({
|
|
225
|
-
type: "reject",
|
|
226
|
-
error
|
|
227
|
-
});
|
|
228
|
-
/**
|
|
229
|
-
* Helpers to define mock responses for mocked requests.
|
|
230
|
-
*/
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
const RespondWith = Object.freeze({
|
|
234
|
-
/**
|
|
235
|
-
* Response with text body and status code.
|
|
236
|
-
* Status code defaults to 200.
|
|
237
|
-
*/
|
|
238
|
-
text: (text, statusCode = 200) => textResponse(text, statusCode),
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* Response with JSON body and status code 200.
|
|
242
|
-
*/
|
|
243
|
-
json: json => textResponse(() => JSON.stringify(json)),
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Response with GraphQL data JSON body and status code 200.
|
|
247
|
-
*/
|
|
248
|
-
graphQLData: data => textResponse(() => JSON.stringify({
|
|
249
|
-
data
|
|
250
|
-
})),
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Response with body that will not parse as JSON and status code 200.
|
|
254
|
-
*/
|
|
255
|
-
unparseableBody: () => textResponse("INVALID JSON"),
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Rejects with an AbortError to simulate an aborted request.
|
|
259
|
-
*/
|
|
260
|
-
abortedRequest: () => rejectResponse(() => {
|
|
261
|
-
const abortError = new Error("Mock request aborted");
|
|
262
|
-
abortError.name = "AbortError";
|
|
263
|
-
return abortError;
|
|
264
|
-
}),
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* Rejects with the given error.
|
|
268
|
-
*/
|
|
269
|
-
reject: error => rejectResponse(error),
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* A non-200 status code with empty text body.
|
|
273
|
-
* Equivalent to calling `ResponseWith.text("", statusCode)`.
|
|
274
|
-
*/
|
|
275
|
-
errorStatusCode: statusCode => {
|
|
276
|
-
if (statusCode < 300) {
|
|
277
|
-
throw new Error(`${statusCode} is not a valid error status code`);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
return textResponse("{}", statusCode);
|
|
281
|
-
},
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Response body that is valid JSON but not a valid GraphQL response.
|
|
285
|
-
*/
|
|
286
|
-
nonGraphQLBody: () => textResponse(() => JSON.stringify({
|
|
287
|
-
valid: "json",
|
|
288
|
-
that: "is not a valid graphql response"
|
|
289
|
-
})),
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* Response that is a GraphQL errors response with status code 200.
|
|
293
|
-
*/
|
|
294
|
-
graphQLErrors: errorMessages => textResponse(() => JSON.stringify({
|
|
295
|
-
errors: errorMessages.map(e => ({
|
|
296
|
-
message: e
|
|
297
|
-
}))
|
|
298
|
-
}))
|
|
299
|
-
});
|
|
300
|
-
/**
|
|
301
|
-
* Turns a MockResponse value to an actual Response that represents the mock.
|
|
302
|
-
*/
|
|
217
|
+
/* 5 */
|
|
218
|
+
/***/ (function(module, exports) {
|
|
303
219
|
|
|
304
|
-
|
|
305
|
-
switch (response.type) {
|
|
306
|
-
case "text":
|
|
307
|
-
const text = typeof response.text === "function" ? response.text() : response.text;
|
|
308
|
-
return Promise.resolve(new _response_impl_js__WEBPACK_IMPORTED_MODULE_0__[/* ResponseImpl */ "a"](text, {
|
|
309
|
-
status: response.statusCode
|
|
310
|
-
}));
|
|
220
|
+
var id = 0;
|
|
311
221
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
222
|
+
function _classPrivateFieldKey(name) {
|
|
223
|
+
return "__private_" + id++ + "_" + name;
|
|
224
|
+
}
|
|
315
225
|
|
|
316
|
-
|
|
317
|
-
throw new Error(`Unknown response type: ${response.type}`);
|
|
318
|
-
}
|
|
319
|
-
};
|
|
226
|
+
module.exports = _classPrivateFieldKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
320
227
|
|
|
321
228
|
/***/ }),
|
|
322
|
-
/*
|
|
229
|
+
/* 6 */
|
|
323
230
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
324
231
|
|
|
325
232
|
"use strict";
|
|
326
233
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return makeHookHarness; });
|
|
327
234
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
328
235
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
329
|
-
/* harmony import */ var _make_test_harness_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
236
|
+
/* harmony import */ var _make_test_harness_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
|
330
237
|
|
|
331
238
|
|
|
332
239
|
|
|
@@ -362,14 +269,11 @@ const makeHookHarness = (adapters, defaultConfigs) => {
|
|
|
362
269
|
};
|
|
363
270
|
|
|
364
271
|
/***/ }),
|
|
365
|
-
/*
|
|
272
|
+
/* 7 */
|
|
366
273
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
367
274
|
|
|
368
275
|
"use strict";
|
|
369
276
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return mockRequester; });
|
|
370
|
-
/* harmony import */ var _make_mock_response_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
|
|
371
|
-
|
|
372
|
-
|
|
373
277
|
/**
|
|
374
278
|
* A generic mock request function for using when mocking fetch or gqlFetch.
|
|
375
279
|
*/
|
|
@@ -401,7 +305,7 @@ const mockRequester = (operationMatcher, operationToString) => {
|
|
|
401
305
|
};
|
|
402
306
|
|
|
403
307
|
const addMockedOperation = (operation, response, onceOnly) => {
|
|
404
|
-
const mockResponse = () =>
|
|
308
|
+
const mockResponse = () => response.toPromise();
|
|
405
309
|
|
|
406
310
|
mocks.push({
|
|
407
311
|
operation,
|
|
@@ -420,13 +324,74 @@ const mockRequester = (operationMatcher, operationToString) => {
|
|
|
420
324
|
};
|
|
421
325
|
|
|
422
326
|
/***/ }),
|
|
423
|
-
/*
|
|
327
|
+
/* 8 */
|
|
328
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
329
|
+
|
|
330
|
+
"use strict";
|
|
331
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SettleSignal; });
|
|
332
|
+
/* harmony import */ var _babel_runtime_helpers_classPrivateFieldLooseBase__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
|
|
333
|
+
/* harmony import */ var _babel_runtime_helpers_classPrivateFieldLooseBase__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classPrivateFieldLooseBase__WEBPACK_IMPORTED_MODULE_0__);
|
|
334
|
+
/* harmony import */ var _babel_runtime_helpers_classPrivateFieldLooseKey__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
|
|
335
|
+
/* harmony import */ var _babel_runtime_helpers_classPrivateFieldLooseKey__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classPrivateFieldLooseKey__WEBPACK_IMPORTED_MODULE_1__);
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
var _settled = /*#__PURE__*/_babel_runtime_helpers_classPrivateFieldLooseKey__WEBPACK_IMPORTED_MODULE_1___default()("settled");
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* A signal for controlling the `RespondWith` API responses.
|
|
343
|
+
*
|
|
344
|
+
* This provide finely-grained control over the promise lifecycle to support
|
|
345
|
+
* complex test scenarios.
|
|
346
|
+
*/
|
|
347
|
+
class SettleSignal extends EventTarget {
|
|
348
|
+
constructor(setSettleFn = null) {
|
|
349
|
+
super(); // If we were given a function, we call it with a method that will
|
|
350
|
+
// settle ourselves. This allows the appropriate SettleController
|
|
351
|
+
// to be in charge of settling this instance.
|
|
352
|
+
|
|
353
|
+
Object.defineProperty(this, _settled, {
|
|
354
|
+
writable: true,
|
|
355
|
+
value: false
|
|
356
|
+
});
|
|
357
|
+
setSettleFn == null ? void 0 : setSettleFn(() => {
|
|
358
|
+
if (_babel_runtime_helpers_classPrivateFieldLooseBase__WEBPACK_IMPORTED_MODULE_0___default()(this, _settled)[_settled]) {
|
|
359
|
+
throw new Error("SettleSignal already settled");
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
_babel_runtime_helpers_classPrivateFieldLooseBase__WEBPACK_IMPORTED_MODULE_0___default()(this, _settled)[_settled] = true;
|
|
363
|
+
this.dispatchEvent(new Event("settled"));
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* An already settled signal.
|
|
368
|
+
*/
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
static settle() {
|
|
372
|
+
const signal = new SettleSignal();
|
|
373
|
+
_babel_runtime_helpers_classPrivateFieldLooseBase__WEBPACK_IMPORTED_MODULE_0___default()(signal, _settled)[_settled] = true;
|
|
374
|
+
return signal;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Has this signal been settled yet?
|
|
378
|
+
*/
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
get settled() {
|
|
382
|
+
return _babel_runtime_helpers_classPrivateFieldLooseBase__WEBPACK_IMPORTED_MODULE_0___default()(this, _settled)[_settled];
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/***/ }),
|
|
388
|
+
/* 9 */
|
|
424
389
|
/***/ (function(module, exports) {
|
|
425
390
|
|
|
426
391
|
module.exports = require("@storybook/addon-actions");
|
|
427
392
|
|
|
428
393
|
/***/ }),
|
|
429
|
-
/*
|
|
394
|
+
/* 10 */
|
|
430
395
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
431
396
|
|
|
432
397
|
"use strict";
|
|
@@ -490,7 +455,7 @@ const adapter = (children, config) => {
|
|
|
490
455
|
};
|
|
491
456
|
|
|
492
457
|
/***/ }),
|
|
493
|
-
/*
|
|
458
|
+
/* 11 */
|
|
494
459
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
495
460
|
|
|
496
461
|
"use strict";
|
|
@@ -498,7 +463,7 @@ const adapter = (children, config) => {
|
|
|
498
463
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return adapter; });
|
|
499
464
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
500
465
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
501
|
-
/* harmony import */ var _khanacademy_wonder_blocks_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
466
|
+
/* harmony import */ var _khanacademy_wonder_blocks_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25);
|
|
502
467
|
/* harmony import */ var _khanacademy_wonder_blocks_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_data__WEBPACK_IMPORTED_MODULE_1__);
|
|
503
468
|
|
|
504
469
|
|
|
@@ -536,7 +501,7 @@ const adapter = (children, config) => {
|
|
|
536
501
|
};
|
|
537
502
|
|
|
538
503
|
/***/ }),
|
|
539
|
-
/*
|
|
504
|
+
/* 12 */
|
|
540
505
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
541
506
|
|
|
542
507
|
"use strict";
|
|
@@ -561,7 +526,7 @@ const adapter = (children, config) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODUL
|
|
|
561
526
|
}), children);
|
|
562
527
|
|
|
563
528
|
/***/ }),
|
|
564
|
-
/*
|
|
529
|
+
/* 13 */
|
|
565
530
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
566
531
|
|
|
567
532
|
"use strict";
|
|
@@ -569,7 +534,7 @@ const adapter = (children, config) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODUL
|
|
|
569
534
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return adapter; });
|
|
570
535
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
571
536
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
572
|
-
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
537
|
+
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
|
|
573
538
|
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_1__);
|
|
574
539
|
|
|
575
540
|
|
|
@@ -679,14 +644,14 @@ const adapter = (children, config) => {
|
|
|
679
644
|
};
|
|
680
645
|
|
|
681
646
|
/***/ }),
|
|
682
|
-
/*
|
|
647
|
+
/* 14 */
|
|
683
648
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
684
649
|
|
|
685
650
|
"use strict";
|
|
686
651
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return fixtures; });
|
|
687
652
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
688
653
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
689
|
-
/* harmony import */ var _storybook_addon_actions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
654
|
+
/* harmony import */ var _storybook_addon_actions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
|
|
690
655
|
/* harmony import */ var _storybook_addon_actions__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_1__);
|
|
691
656
|
|
|
692
657
|
|
|
@@ -752,13 +717,13 @@ const fixtures = Component => {
|
|
|
752
717
|
};
|
|
753
718
|
|
|
754
719
|
/***/ }),
|
|
755
|
-
/*
|
|
720
|
+
/* 15 */
|
|
756
721
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
757
722
|
|
|
758
723
|
"use strict";
|
|
759
724
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return mockFetch; });
|
|
760
|
-
/* harmony import */ var _fetch_request_matches_mock_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
761
|
-
/* harmony import */ var _mock_requester_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
725
|
+
/* harmony import */ var _fetch_request_matches_mock_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
|
|
726
|
+
/* harmony import */ var _mock_requester_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
|
|
762
727
|
|
|
763
728
|
|
|
764
729
|
|
|
@@ -769,13 +734,13 @@ const mockFetch = () => Object(_mock_requester_js__WEBPACK_IMPORTED_MODULE_1__[/
|
|
|
769
734
|
Options: ${init == null ? "None" : JSON.stringify(init, null, 2)}`);
|
|
770
735
|
|
|
771
736
|
/***/ }),
|
|
772
|
-
/*
|
|
737
|
+
/* 16 */
|
|
773
738
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
774
739
|
|
|
775
740
|
"use strict";
|
|
776
741
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return mockGqlFetch; });
|
|
777
|
-
/* harmony import */ var _gql_request_matches_mock_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
778
|
-
/* harmony import */ var _mock_requester_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
742
|
+
/* harmony import */ var _gql_request_matches_mock_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23);
|
|
743
|
+
/* harmony import */ var _mock_requester_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
|
|
779
744
|
|
|
780
745
|
|
|
781
746
|
|
|
@@ -787,7 +752,225 @@ const mockGqlFetch = () => Object(_mock_requester_js__WEBPACK_IMPORTED_MODULE_1_
|
|
|
787
752
|
Context: ${JSON.stringify(context, null, 2)}`);
|
|
788
753
|
|
|
789
754
|
/***/ }),
|
|
790
|
-
/*
|
|
755
|
+
/* 17 */
|
|
756
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
757
|
+
|
|
758
|
+
"use strict";
|
|
759
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RespondWith; });
|
|
760
|
+
/* harmony import */ var _settle_signal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
|
|
761
|
+
/* harmony import */ var _response_impl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24);
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* Helper for creating a text-based mock response.
|
|
767
|
+
*/
|
|
768
|
+
const textResponse = (text, statusCode, signal) => ({
|
|
769
|
+
toPromise: () => makeMockResponse({
|
|
770
|
+
type: "text",
|
|
771
|
+
text,
|
|
772
|
+
statusCode,
|
|
773
|
+
signal
|
|
774
|
+
})
|
|
775
|
+
});
|
|
776
|
+
/**
|
|
777
|
+
* Helper for creating a rejected mock response.
|
|
778
|
+
*/
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
const rejectResponse = (error, signal) => ({
|
|
782
|
+
toPromise: () => makeMockResponse({
|
|
783
|
+
type: "reject",
|
|
784
|
+
error,
|
|
785
|
+
signal
|
|
786
|
+
})
|
|
787
|
+
});
|
|
788
|
+
/**
|
|
789
|
+
* Helpers to define mock responses for mocked requests.
|
|
790
|
+
*/
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
const RespondWith = Object.freeze({
|
|
794
|
+
/**
|
|
795
|
+
* Response with text body and status code.
|
|
796
|
+
* Status code defaults to 200.
|
|
797
|
+
*/
|
|
798
|
+
text: (text, statusCode = 200, signal = null) => textResponse(text, statusCode, signal),
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* Response with JSON body and status code 200.
|
|
802
|
+
*/
|
|
803
|
+
json: (json, signal = null) => textResponse(() => JSON.stringify(json), 200, signal),
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* Response with GraphQL data JSON body and status code 200.
|
|
807
|
+
*/
|
|
808
|
+
graphQLData: (data, signal = null) => textResponse(() => JSON.stringify({
|
|
809
|
+
data
|
|
810
|
+
}), 200, signal),
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* Response with body that will not parse as JSON and status code 200.
|
|
814
|
+
*/
|
|
815
|
+
unparseableBody: (signal = null) => textResponse("INVALID JSON", 200, signal),
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* Rejects with an AbortError to simulate an aborted request.
|
|
819
|
+
*/
|
|
820
|
+
abortedRequest: (signal = null) => rejectResponse(() => {
|
|
821
|
+
const abortError = new Error("Mock request aborted");
|
|
822
|
+
abortError.name = "AbortError";
|
|
823
|
+
return abortError;
|
|
824
|
+
}, signal),
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Rejects with the given error.
|
|
828
|
+
*/
|
|
829
|
+
reject: (error, signal = null) => rejectResponse(error, signal),
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* A non-200 status code with empty text body.
|
|
833
|
+
* Equivalent to calling `ResponseWith.text("", statusCode)`.
|
|
834
|
+
*/
|
|
835
|
+
errorStatusCode: (statusCode, signal = null) => {
|
|
836
|
+
if (statusCode < 300) {
|
|
837
|
+
throw new Error(`${statusCode} is not a valid error status code`);
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
return textResponse("{}", statusCode, signal);
|
|
841
|
+
},
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* Response body that is valid JSON but not a valid GraphQL response.
|
|
845
|
+
*/
|
|
846
|
+
nonGraphQLBody: (signal = null) => textResponse(() => JSON.stringify({
|
|
847
|
+
valid: "json",
|
|
848
|
+
that: "is not a valid graphql response"
|
|
849
|
+
}), 200, signal),
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
* Response that is a GraphQL errors response with status code 200.
|
|
853
|
+
*/
|
|
854
|
+
graphQLErrors: (errorMessages, signal = null) => textResponse(() => JSON.stringify({
|
|
855
|
+
errors: errorMessages.map(e => ({
|
|
856
|
+
message: e
|
|
857
|
+
}))
|
|
858
|
+
}), 200, signal)
|
|
859
|
+
});
|
|
860
|
+
|
|
861
|
+
const callOnSettled = (signal, fn) => {
|
|
862
|
+
if (signal == null || signal.settled) {
|
|
863
|
+
fn();
|
|
864
|
+
return;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
const onSettled = () => {
|
|
868
|
+
signal.removeEventListener("settled", onSettled);
|
|
869
|
+
fn();
|
|
870
|
+
};
|
|
871
|
+
|
|
872
|
+
signal.addEventListener("settled", onSettled);
|
|
873
|
+
};
|
|
874
|
+
/**
|
|
875
|
+
* Turns a MockResponse value to an actual Response that represents the mock.
|
|
876
|
+
*/
|
|
877
|
+
|
|
878
|
+
|
|
879
|
+
const makeMockResponse = response => {
|
|
880
|
+
const {
|
|
881
|
+
signal
|
|
882
|
+
} = response;
|
|
883
|
+
|
|
884
|
+
switch (response.type) {
|
|
885
|
+
case "text":
|
|
886
|
+
return new Promise((resolve, reject) => {
|
|
887
|
+
callOnSettled(signal, () => {
|
|
888
|
+
const text = typeof response.text === "function" ? response.text() : response.text;
|
|
889
|
+
resolve(new _response_impl_js__WEBPACK_IMPORTED_MODULE_1__[/* ResponseImpl */ "a"](text, {
|
|
890
|
+
status: response.statusCode
|
|
891
|
+
}));
|
|
892
|
+
});
|
|
893
|
+
});
|
|
894
|
+
|
|
895
|
+
case "reject":
|
|
896
|
+
return new Promise((resolve, reject) => {
|
|
897
|
+
callOnSettled(signal, () => reject(response.error instanceof Error ? response.error : response.error()));
|
|
898
|
+
});
|
|
899
|
+
|
|
900
|
+
/* istanbul ignore next */
|
|
901
|
+
|
|
902
|
+
default:
|
|
903
|
+
if (false) {} // Production; assume a rejection.
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
return makeMockResponse({
|
|
907
|
+
type: "reject",
|
|
908
|
+
error: new Error("Unknown response type"),
|
|
909
|
+
signal
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
};
|
|
913
|
+
|
|
914
|
+
/***/ }),
|
|
915
|
+
/* 18 */
|
|
916
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
917
|
+
|
|
918
|
+
"use strict";
|
|
919
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SettleController; });
|
|
920
|
+
/* harmony import */ var _babel_runtime_helpers_classPrivateFieldLooseBase__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
|
|
921
|
+
/* harmony import */ var _babel_runtime_helpers_classPrivateFieldLooseBase__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classPrivateFieldLooseBase__WEBPACK_IMPORTED_MODULE_0__);
|
|
922
|
+
/* harmony import */ var _babel_runtime_helpers_classPrivateFieldLooseKey__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
|
|
923
|
+
/* harmony import */ var _babel_runtime_helpers_classPrivateFieldLooseKey__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classPrivateFieldLooseKey__WEBPACK_IMPORTED_MODULE_1__);
|
|
924
|
+
/* harmony import */ var _settle_signal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8);
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* A controller for the `RespondWith` API to control response settlement.
|
|
930
|
+
*/
|
|
931
|
+
|
|
932
|
+
var _settleFn = /*#__PURE__*/_babel_runtime_helpers_classPrivateFieldLooseKey__WEBPACK_IMPORTED_MODULE_1___default()("settleFn");
|
|
933
|
+
|
|
934
|
+
var _signal = /*#__PURE__*/_babel_runtime_helpers_classPrivateFieldLooseKey__WEBPACK_IMPORTED_MODULE_1___default()("signal");
|
|
935
|
+
|
|
936
|
+
class SettleController {
|
|
937
|
+
constructor() {
|
|
938
|
+
Object.defineProperty(this, _settleFn, {
|
|
939
|
+
writable: true,
|
|
940
|
+
value: void 0
|
|
941
|
+
});
|
|
942
|
+
Object.defineProperty(this, _signal, {
|
|
943
|
+
writable: true,
|
|
944
|
+
value: void 0
|
|
945
|
+
});
|
|
946
|
+
// Create our signal.
|
|
947
|
+
// We pass in a method to capture it's settle function so that
|
|
948
|
+
// only we can call it.
|
|
949
|
+
_babel_runtime_helpers_classPrivateFieldLooseBase__WEBPACK_IMPORTED_MODULE_0___default()(this, _signal)[_signal] = new _settle_signal_js__WEBPACK_IMPORTED_MODULE_2__[/* SettleSignal */ "a"](settleFn => _babel_runtime_helpers_classPrivateFieldLooseBase__WEBPACK_IMPORTED_MODULE_0___default()(this, _settleFn)[_settleFn] = settleFn);
|
|
950
|
+
}
|
|
951
|
+
/**
|
|
952
|
+
* The signal to pass to the `RespondWith` API.
|
|
953
|
+
*/
|
|
954
|
+
|
|
955
|
+
|
|
956
|
+
get signal() {
|
|
957
|
+
return _babel_runtime_helpers_classPrivateFieldLooseBase__WEBPACK_IMPORTED_MODULE_0___default()(this, _signal)[_signal];
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* Settle the signal and therefore any associated responses.
|
|
961
|
+
*
|
|
962
|
+
* @throws {Error} if the signal has already been settled.
|
|
963
|
+
*/
|
|
964
|
+
|
|
965
|
+
|
|
966
|
+
settle() {
|
|
967
|
+
_babel_runtime_helpers_classPrivateFieldLooseBase__WEBPACK_IMPORTED_MODULE_0___default()(this, _settleFn)[_settleFn]();
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
/***/ }),
|
|
973
|
+
/* 19 */
|
|
791
974
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
792
975
|
|
|
793
976
|
"use strict";
|
|
@@ -799,15 +982,15 @@ const mockGqlFetch = () => Object(_mock_requester_js__WEBPACK_IMPORTED_MODULE_1_
|
|
|
799
982
|
*/
|
|
800
983
|
|
|
801
984
|
/***/ }),
|
|
802
|
-
/*
|
|
985
|
+
/* 20 */
|
|
803
986
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
804
987
|
|
|
805
988
|
"use strict";
|
|
806
989
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hookHarness; });
|
|
807
990
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
808
991
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
809
|
-
/* harmony import */ var _make_hook_harness_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
810
|
-
/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
992
|
+
/* harmony import */ var _make_hook_harness_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
|
|
993
|
+
/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
|
|
811
994
|
|
|
812
995
|
|
|
813
996
|
|
|
@@ -824,15 +1007,15 @@ const mockGqlFetch = () => Object(_mock_requester_js__WEBPACK_IMPORTED_MODULE_1_
|
|
|
824
1007
|
const hookHarness = Object(_make_hook_harness_js__WEBPACK_IMPORTED_MODULE_1__[/* makeHookHarness */ "a"])(_adapters_adapters_js__WEBPACK_IMPORTED_MODULE_2__["DefaultAdapters"], _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_2__["DefaultConfigs"]);
|
|
825
1008
|
|
|
826
1009
|
/***/ }),
|
|
827
|
-
/*
|
|
1010
|
+
/* 21 */
|
|
828
1011
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
829
1012
|
|
|
830
1013
|
"use strict";
|
|
831
1014
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return testHarness; });
|
|
832
1015
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
833
1016
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
834
|
-
/* harmony import */ var _make_test_harness_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
835
|
-
/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
1017
|
+
/* harmony import */ var _make_test_harness_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
|
1018
|
+
/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
|
|
836
1019
|
|
|
837
1020
|
|
|
838
1021
|
|
|
@@ -849,7 +1032,7 @@ const hookHarness = Object(_make_hook_harness_js__WEBPACK_IMPORTED_MODULE_1__[/*
|
|
|
849
1032
|
const testHarness = Object(_make_test_harness_js__WEBPACK_IMPORTED_MODULE_1__[/* makeTestHarness */ "a"])(_adapters_adapters_js__WEBPACK_IMPORTED_MODULE_2__["DefaultAdapters"], _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_2__["DefaultConfigs"]);
|
|
850
1033
|
|
|
851
1034
|
/***/ }),
|
|
852
|
-
/*
|
|
1035
|
+
/* 22 */
|
|
853
1036
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
854
1037
|
|
|
855
1038
|
"use strict";
|
|
@@ -892,20 +1075,7 @@ const fetchRequestMatchesMock = (mock, input, init) => {
|
|
|
892
1075
|
};
|
|
893
1076
|
|
|
894
1077
|
/***/ }),
|
|
895
|
-
/*
|
|
896
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
897
|
-
|
|
898
|
-
"use strict";
|
|
899
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ResponseImpl; });
|
|
900
|
-
// We need a version of Response. When we're in Jest JSDOM environment or a
|
|
901
|
-
// version of Node that supports the fetch API (17 and up, possibly with
|
|
902
|
-
// --experimental-fetch flag), then we're good, but otherwise we need an
|
|
903
|
-
// implementation, so this uses node-fetch as a peer dependency and uses that
|
|
904
|
-
// to provide the implementation if we don't already have one.
|
|
905
|
-
const ResponseImpl = typeof Response === "undefined" ? __webpack_require__(24).Response : Response;
|
|
906
|
-
|
|
907
|
-
/***/ }),
|
|
908
|
-
/* 20 */
|
|
1078
|
+
/* 23 */
|
|
909
1079
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
910
1080
|
|
|
911
1081
|
"use strict";
|
|
@@ -980,13 +1150,49 @@ const gqlRequestMatchesMock = (mock, operation, variables, context) => {
|
|
|
980
1150
|
};
|
|
981
1151
|
|
|
982
1152
|
/***/ }),
|
|
983
|
-
/*
|
|
1153
|
+
/* 24 */
|
|
1154
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1155
|
+
|
|
1156
|
+
"use strict";
|
|
1157
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ResponseImpl; });
|
|
1158
|
+
// We need a version of Response. When we're in Jest JSDOM environment or a
|
|
1159
|
+
// version of Node that supports the fetch API (17 and up, possibly with
|
|
1160
|
+
// --experimental-fetch flag), then we're good, but otherwise we need an
|
|
1161
|
+
// implementation, so this uses node-fetch as a peer dependency and uses that
|
|
1162
|
+
// to provide the implementation if we don't already have one.
|
|
1163
|
+
const ResponseImpl = typeof Response === "undefined" ? __webpack_require__(29).Response : Response;
|
|
1164
|
+
|
|
1165
|
+
/***/ }),
|
|
1166
|
+
/* 25 */
|
|
984
1167
|
/***/ (function(module, exports) {
|
|
985
1168
|
|
|
986
1169
|
module.exports = require("@khanacademy/wonder-blocks-data");
|
|
987
1170
|
|
|
988
1171
|
/***/ }),
|
|
989
|
-
/*
|
|
1172
|
+
/* 26 */
|
|
1173
|
+
/***/ (function(module, exports) {
|
|
1174
|
+
|
|
1175
|
+
function _extends() {
|
|
1176
|
+
module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
1177
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1178
|
+
var source = arguments[i];
|
|
1179
|
+
|
|
1180
|
+
for (var key in source) {
|
|
1181
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1182
|
+
target[key] = source[key];
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
return target;
|
|
1188
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
1189
|
+
return _extends.apply(this, arguments);
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
1193
|
+
|
|
1194
|
+
/***/ }),
|
|
1195
|
+
/* 27 */
|
|
990
1196
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
991
1197
|
|
|
992
1198
|
"use strict";
|
|
@@ -1018,37 +1224,40 @@ const renderAdapters = (adapters, configs, children) => {
|
|
|
1018
1224
|
};
|
|
1019
1225
|
|
|
1020
1226
|
/***/ }),
|
|
1021
|
-
/*
|
|
1227
|
+
/* 28 */
|
|
1022
1228
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1023
1229
|
|
|
1024
1230
|
"use strict";
|
|
1025
1231
|
__webpack_require__.r(__webpack_exports__);
|
|
1026
|
-
/* harmony import */ var _fixtures_fixtures_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
1232
|
+
/* harmony import */ var _fixtures_fixtures_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
|
|
1027
1233
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fixtures", function() { return _fixtures_fixtures_js__WEBPACK_IMPORTED_MODULE_0__["a"]; });
|
|
1028
1234
|
|
|
1029
|
-
/* harmony import */ var _fetch_mock_fetch_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
1235
|
+
/* harmony import */ var _fetch_mock_fetch_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15);
|
|
1030
1236
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mockFetch", function() { return _fetch_mock_fetch_js__WEBPACK_IMPORTED_MODULE_1__["a"]; });
|
|
1031
1237
|
|
|
1032
|
-
/* harmony import */ var _gql_mock_gql_fetch_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
1238
|
+
/* harmony import */ var _gql_mock_gql_fetch_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16);
|
|
1033
1239
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mockGqlFetch", function() { return _gql_mock_gql_fetch_js__WEBPACK_IMPORTED_MODULE_2__["a"]; });
|
|
1034
1240
|
|
|
1035
|
-
/* harmony import */ var
|
|
1036
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RespondWith", function() { return
|
|
1241
|
+
/* harmony import */ var _respond_with_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17);
|
|
1242
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RespondWith", function() { return _respond_with_js__WEBPACK_IMPORTED_MODULE_3__["a"]; });
|
|
1243
|
+
|
|
1244
|
+
/* harmony import */ var _settle_controller_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(18);
|
|
1245
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SettleController", function() { return _settle_controller_js__WEBPACK_IMPORTED_MODULE_4__["a"]; });
|
|
1037
1246
|
|
|
1038
|
-
/* harmony import */ var
|
|
1039
|
-
/* harmony import */ var
|
|
1040
|
-
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "harnessAdapters", function() { return
|
|
1041
|
-
/* harmony import */ var
|
|
1042
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeHookHarness", function() { return
|
|
1247
|
+
/* harmony import */ var _harness_types_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(19);
|
|
1248
|
+
/* harmony import */ var _harness_adapters_adapters_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
|
|
1249
|
+
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "harnessAdapters", function() { return _harness_adapters_adapters_js__WEBPACK_IMPORTED_MODULE_6__; });
|
|
1250
|
+
/* harmony import */ var _harness_make_hook_harness_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6);
|
|
1251
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeHookHarness", function() { return _harness_make_hook_harness_js__WEBPACK_IMPORTED_MODULE_7__["a"]; });
|
|
1043
1252
|
|
|
1044
|
-
/* harmony import */ var
|
|
1045
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeTestHarness", function() { return
|
|
1253
|
+
/* harmony import */ var _harness_make_test_harness_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4);
|
|
1254
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeTestHarness", function() { return _harness_make_test_harness_js__WEBPACK_IMPORTED_MODULE_8__["a"]; });
|
|
1046
1255
|
|
|
1047
|
-
/* harmony import */ var
|
|
1048
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hookHarness", function() { return
|
|
1256
|
+
/* harmony import */ var _harness_hook_harness_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(20);
|
|
1257
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hookHarness", function() { return _harness_hook_harness_js__WEBPACK_IMPORTED_MODULE_9__["a"]; });
|
|
1049
1258
|
|
|
1050
|
-
/* harmony import */ var
|
|
1051
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "testHarness", function() { return
|
|
1259
|
+
/* harmony import */ var _harness_test_harness_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(21);
|
|
1260
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "testHarness", function() { return _harness_test_harness_js__WEBPACK_IMPORTED_MODULE_10__["a"]; });
|
|
1052
1261
|
|
|
1053
1262
|
// Fixtures framework
|
|
1054
1263
|
|
|
@@ -1056,6 +1265,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1056
1265
|
|
|
1057
1266
|
|
|
1058
1267
|
|
|
1268
|
+
|
|
1059
1269
|
// Test harness framework
|
|
1060
1270
|
|
|
1061
1271
|
|
|
@@ -1066,7 +1276,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1066
1276
|
|
|
1067
1277
|
|
|
1068
1278
|
/***/ }),
|
|
1069
|
-
/*
|
|
1279
|
+
/* 29 */
|
|
1070
1280
|
/***/ (function(module, exports) {
|
|
1071
1281
|
|
|
1072
1282
|
module.exports = require("node-fetch");
|