react-test-renderer 16.12.0 → 16.13.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/build-info.json +4 -4
- package/cjs/react-test-renderer-shallow.development.js +104 -141
- package/cjs/react-test-renderer-shallow.production.min.js +23 -22
- package/cjs/react-test-renderer.development.js +2241 -4549
- package/cjs/react-test-renderer.production.min.js +172 -175
- package/package.json +2 -2
- package/umd/react-test-renderer-shallow.development.js +884 -964
- package/umd/react-test-renderer-shallow.production.min.js +24 -24
- package/umd/react-test-renderer.development.js +12186 -14505
- package/umd/react-test-renderer.production.min.js +144 -145
package/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"branch": "master",
|
|
3
|
-
"buildNumber": "
|
|
4
|
-
"checksum": "
|
|
5
|
-
"commit": "
|
|
3
|
+
"buildNumber": "91354",
|
|
4
|
+
"checksum": "b0ed8f5",
|
|
5
|
+
"commit": "d28bd2994",
|
|
6
6
|
"environment": "ci",
|
|
7
|
-
"reactVersion": "16.
|
|
7
|
+
"reactVersion": "16.12.0-d28bd2994"
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.13.0
|
|
2
2
|
* react-test-renderer-shallow.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -23,9 +23,83 @@ var checkPropTypes = require('prop-types/checkPropTypes');
|
|
|
23
23
|
// Do not require this module directly! Use normal `invariant` calls with
|
|
24
24
|
// template literal strings. The messages will be replaced with error codes
|
|
25
25
|
// during build.
|
|
26
|
+
function formatProdErrorMessage(code) {
|
|
27
|
+
var url = 'https://reactjs.org/docs/error-decoder.html?invariant=' + code;
|
|
28
|
+
|
|
29
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
30
|
+
url += '&args[]=' + encodeURIComponent(arguments[i]);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return "Minified React error #" + code + "; visit " + url + " for the full message or " + 'use the non-minified dev environment for full errors and additional ' + 'helpful warnings.';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions.
|
|
37
|
+
// Current owner and dispatcher used to share the same ref,
|
|
38
|
+
// but PR #14548 split them out to better support the react-debug-tools package.
|
|
39
|
+
|
|
40
|
+
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
|
|
41
|
+
ReactSharedInternals.ReactCurrentDispatcher = {
|
|
42
|
+
current: null
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
|
|
47
|
+
ReactSharedInternals.ReactCurrentBatchConfig = {
|
|
48
|
+
suspense: null
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function error(format) {
|
|
53
|
+
{
|
|
54
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
55
|
+
args[_key2 - 1] = arguments[_key2];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
printWarning('error', format, args);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function printWarning(level, format, args) {
|
|
63
|
+
// When changing this logic, you might want to also
|
|
64
|
+
// update consoleWithStackDev.www.js as well.
|
|
65
|
+
{
|
|
66
|
+
var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0;
|
|
67
|
+
|
|
68
|
+
if (!hasExistingStack) {
|
|
69
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
70
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
71
|
+
|
|
72
|
+
if (stack !== '') {
|
|
73
|
+
format += '%s';
|
|
74
|
+
args = args.concat([stack]);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
var argsWithFormat = args.map(function (item) {
|
|
79
|
+
return '' + item;
|
|
80
|
+
}); // Careful: RN currently depends on this prefix
|
|
81
|
+
|
|
82
|
+
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
83
|
+
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
84
|
+
// eslint-disable-next-line react-internal/no-production-logging
|
|
85
|
+
|
|
86
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
// --- Welcome to debugging React ---
|
|
90
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
91
|
+
// to find the callsite that caused this warning to fire.
|
|
92
|
+
var argIndex = 0;
|
|
93
|
+
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
94
|
+
return args[argIndex++];
|
|
95
|
+
});
|
|
96
|
+
throw new Error(message);
|
|
97
|
+
} catch (x) {}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
26
100
|
|
|
27
101
|
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
28
|
-
|
|
102
|
+
function describeComponentFrame (name, source, ownerName) {
|
|
29
103
|
var sourceInfo = '';
|
|
30
104
|
|
|
31
105
|
if (source) {
|
|
@@ -55,126 +129,25 @@ var describeComponentFrame = function (name, source, ownerName) {
|
|
|
55
129
|
}
|
|
56
130
|
|
|
57
131
|
return '\n in ' + (name || 'Unknown') + sourceInfo;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Similar to invariant but only logs a warning if the condition is not met.
|
|
62
|
-
* This can be used to log issues in development environments in critical
|
|
63
|
-
* paths. Removing the logging code for production environments will keep the
|
|
64
|
-
* same logic and follow the same code paths.
|
|
65
|
-
*/
|
|
66
|
-
var warningWithoutStack = function () {};
|
|
67
|
-
|
|
68
|
-
{
|
|
69
|
-
warningWithoutStack = function (condition, format) {
|
|
70
|
-
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
71
|
-
args[_key - 2] = arguments[_key];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (format === undefined) {
|
|
75
|
-
throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (args.length > 8) {
|
|
79
|
-
// Check before the condition to catch violations early.
|
|
80
|
-
throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (condition) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (typeof console !== 'undefined') {
|
|
88
|
-
var argsWithFormat = args.map(function (item) {
|
|
89
|
-
return '' + item;
|
|
90
|
-
});
|
|
91
|
-
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
92
|
-
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
93
|
-
|
|
94
|
-
Function.prototype.apply.call(console.error, console, argsWithFormat);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
try {
|
|
98
|
-
// --- Welcome to debugging React ---
|
|
99
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
100
|
-
// to find the callsite that caused this warning to fire.
|
|
101
|
-
var argIndex = 0;
|
|
102
|
-
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
103
|
-
return args[argIndex++];
|
|
104
|
-
});
|
|
105
|
-
throw new Error(message);
|
|
106
|
-
} catch (x) {}
|
|
107
|
-
};
|
|
108
132
|
}
|
|
109
133
|
|
|
110
|
-
var warningWithoutStack$1 = warningWithoutStack;
|
|
111
|
-
|
|
112
134
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
113
135
|
// nor polyfill, then a plain number is used for performance.
|
|
114
136
|
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
115
|
-
|
|
116
137
|
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
117
138
|
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
118
139
|
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
119
140
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
120
141
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
121
142
|
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
122
|
-
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
143
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
127
144
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
128
145
|
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
129
146
|
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
130
147
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
131
|
-
|
|
132
|
-
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions.
|
|
133
|
-
// Current owner and dispatcher used to share the same ref,
|
|
134
|
-
// but PR #14548 split them out to better support the react-debug-tools package.
|
|
135
|
-
|
|
136
|
-
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
|
|
137
|
-
ReactSharedInternals.ReactCurrentDispatcher = {
|
|
138
|
-
current: null
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
|
|
143
|
-
ReactSharedInternals.ReactCurrentBatchConfig = {
|
|
144
|
-
suspense: null
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Similar to invariant but only logs a warning if the condition is not met.
|
|
150
|
-
* This can be used to log issues in development environments in critical
|
|
151
|
-
* paths. Removing the logging code for production environments will keep the
|
|
152
|
-
* same logic and follow the same code paths.
|
|
153
|
-
*/
|
|
154
|
-
|
|
155
|
-
var warning = warningWithoutStack$1;
|
|
156
|
-
|
|
157
|
-
{
|
|
158
|
-
warning = function (condition, format) {
|
|
159
|
-
if (condition) {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
164
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args
|
|
165
|
-
|
|
166
|
-
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
167
|
-
args[_key - 2] = arguments[_key];
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack]));
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
var warning$1 = warning;
|
|
148
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
175
149
|
|
|
176
150
|
var Resolved = 1;
|
|
177
|
-
|
|
178
151
|
function refineResolvedLazyComponent(lazyComponent) {
|
|
179
152
|
return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
|
180
153
|
}
|
|
@@ -192,7 +165,7 @@ function getComponentName(type) {
|
|
|
192
165
|
|
|
193
166
|
{
|
|
194
167
|
if (typeof type.tag === 'number') {
|
|
195
|
-
|
|
168
|
+
error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
196
169
|
}
|
|
197
170
|
}
|
|
198
171
|
|
|
@@ -238,6 +211,9 @@ function getComponentName(type) {
|
|
|
238
211
|
case REACT_MEMO_TYPE:
|
|
239
212
|
return getComponentName(type.type);
|
|
240
213
|
|
|
214
|
+
case REACT_BLOCK_TYPE:
|
|
215
|
+
return getComponentName(type.render);
|
|
216
|
+
|
|
241
217
|
case REACT_LAZY_TYPE:
|
|
242
218
|
{
|
|
243
219
|
var thenable = type;
|
|
@@ -264,7 +240,7 @@ function is(x, y) {
|
|
|
264
240
|
;
|
|
265
241
|
}
|
|
266
242
|
|
|
267
|
-
var
|
|
243
|
+
var objectIs = typeof Object.is === 'function' ? Object.is : is;
|
|
268
244
|
|
|
269
245
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
270
246
|
/**
|
|
@@ -274,7 +250,7 @@ var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
|
274
250
|
*/
|
|
275
251
|
|
|
276
252
|
function shallowEqual(objA, objB) {
|
|
277
|
-
if (
|
|
253
|
+
if (objectIs(objA, objB)) {
|
|
278
254
|
return true;
|
|
279
255
|
}
|
|
280
256
|
|
|
@@ -291,7 +267,7 @@ function shallowEqual(objA, objB) {
|
|
|
291
267
|
|
|
292
268
|
|
|
293
269
|
for (var i = 0; i < keysA.length; i++) {
|
|
294
|
-
if (!hasOwnProperty.call(objB, keysA[i]) || !
|
|
270
|
+
if (!hasOwnProperty.call(objB, keysA[i]) || !objectIs(objA[keysA[i]], objB[keysA[i]])) {
|
|
295
271
|
return false;
|
|
296
272
|
}
|
|
297
273
|
}
|
|
@@ -299,17 +275,6 @@ function shallowEqual(objA, objB) {
|
|
|
299
275
|
return true;
|
|
300
276
|
}
|
|
301
277
|
|
|
302
|
-
/**
|
|
303
|
-
* Use invariant() to assert state which your program assumes to be true.
|
|
304
|
-
*
|
|
305
|
-
* Provide sprintf-style format (only %s is supported) and arguments
|
|
306
|
-
* to provide information about what broke and what you were
|
|
307
|
-
* expecting.
|
|
308
|
-
*
|
|
309
|
-
* The invariant message will be stripped in production, but the invariant
|
|
310
|
-
* will remain to ensure logic does not differ in production.
|
|
311
|
-
*/
|
|
312
|
-
|
|
313
278
|
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
314
279
|
var RE_RENDER_LIMIT = 25;
|
|
315
280
|
var emptyObject = {};
|
|
@@ -323,18 +288,23 @@ var currentHookNameInDev;
|
|
|
323
288
|
|
|
324
289
|
function areHookInputsEqual(nextDeps, prevDeps) {
|
|
325
290
|
if (prevDeps === null) {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
// passed inline.
|
|
291
|
+
{
|
|
292
|
+
error('%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);
|
|
293
|
+
}
|
|
330
294
|
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
331
297
|
|
|
332
|
-
|
|
333
|
-
|
|
298
|
+
{
|
|
299
|
+
// Don't bother comparing lengths in prod because these arrays should be
|
|
300
|
+
// passed inline.
|
|
301
|
+
if (nextDeps.length !== prevDeps.length) {
|
|
302
|
+
error('The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, "[" + nextDeps.join(', ') + "]", "[" + prevDeps.join(', ') + "]");
|
|
303
|
+
}
|
|
334
304
|
}
|
|
335
305
|
|
|
336
306
|
for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
|
|
337
|
-
if (
|
|
307
|
+
if (objectIs(nextDeps[i], prevDeps[i])) {
|
|
338
308
|
continue;
|
|
339
309
|
}
|
|
340
310
|
|
|
@@ -424,6 +394,7 @@ function createHook() {
|
|
|
424
394
|
}
|
|
425
395
|
|
|
426
396
|
function basicStateReducer(state, action) {
|
|
397
|
+
// $FlowFixMe: Flow doesn't like mixed types
|
|
427
398
|
return typeof action === 'function' ? action(state) : action;
|
|
428
399
|
}
|
|
429
400
|
|
|
@@ -457,7 +428,7 @@ function () {
|
|
|
457
428
|
_proto2._validateCurrentlyRenderingComponent = function _validateCurrentlyRenderingComponent() {
|
|
458
429
|
if (!(this._rendering && !this._instance)) {
|
|
459
430
|
{
|
|
460
|
-
throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");
|
|
431
|
+
throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem." );
|
|
461
432
|
}
|
|
462
433
|
}
|
|
463
434
|
};
|
|
@@ -655,7 +626,7 @@ function () {
|
|
|
655
626
|
_proto2._dispatchAction = function _dispatchAction(queue, action) {
|
|
656
627
|
if (!(this._numberOfReRenders < RE_RENDER_LIMIT)) {
|
|
657
628
|
{
|
|
658
|
-
throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
|
|
629
|
+
throw Error( "Too many re-renders. React limits the number of renders to prevent an infinite loop." );
|
|
659
630
|
}
|
|
660
631
|
}
|
|
661
632
|
|
|
@@ -769,7 +740,7 @@ function () {
|
|
|
769
740
|
|
|
770
741
|
if (!React.isValidElement(element)) {
|
|
771
742
|
{
|
|
772
|
-
throw Error("ReactShallowRenderer render(): Invalid component element." + (typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : ''));
|
|
743
|
+
throw Error( "ReactShallowRenderer render(): Invalid component element." + (typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : '') );
|
|
773
744
|
}
|
|
774
745
|
}
|
|
775
746
|
|
|
@@ -777,13 +748,13 @@ function () {
|
|
|
777
748
|
|
|
778
749
|
if (!(typeof element.type !== 'string')) {
|
|
779
750
|
{
|
|
780
|
-
throw Error("ReactShallowRenderer render(): Shallow rendering works only with custom components, not primitives (" + element.type + "). Instead of calling `.render(el)` and inspecting the rendered output, look at `el.props` directly instead.");
|
|
751
|
+
throw Error( "ReactShallowRenderer render(): Shallow rendering works only with custom components, not primitives (" + element.type + "). Instead of calling `.render(el)` and inspecting the rendered output, look at `el.props` directly instead." );
|
|
781
752
|
}
|
|
782
753
|
}
|
|
783
754
|
|
|
784
755
|
if (!(reactIs.isForwardRef(element) || typeof element.type === 'function' || reactIs.isMemo(element))) {
|
|
785
756
|
{
|
|
786
|
-
throw Error("ReactShallowRenderer render(): Shallow rendering works only with custom components, but the provided element type was `" + (Array.isArray(element.type) ? 'array' : element.type === null ? 'null' : typeof element.type) + "`.");
|
|
757
|
+
throw Error( "ReactShallowRenderer render(): Shallow rendering works only with custom components, but the provided element type was `" + (Array.isArray(element.type) ? 'array' : element.type === null ? 'null' : typeof element.type) + "`." );
|
|
787
758
|
}
|
|
788
759
|
}
|
|
789
760
|
|
|
@@ -849,7 +820,7 @@ function () {
|
|
|
849
820
|
if (elementType.$$typeof === reactIs.ForwardRef) {
|
|
850
821
|
if (!(typeof elementType.render === 'function')) {
|
|
851
822
|
{
|
|
852
|
-
throw Error("forwardRef requires a render function but was given " + typeof elementType.render + ".");
|
|
823
|
+
throw Error(true ? "forwardRef requires a render function but was given " + typeof elementType.render + "." : formatProdErrorMessage(322, typeof elementType.render));
|
|
853
824
|
}
|
|
854
825
|
}
|
|
855
826
|
|
|
@@ -1037,19 +1008,11 @@ function getMaskedContext(contextTypes, unmaskedContext) {
|
|
|
1037
1008
|
return context;
|
|
1038
1009
|
}
|
|
1039
1010
|
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
var ReactShallowRenderer$2 = Object.freeze({
|
|
1043
|
-
default: ReactShallowRenderer
|
|
1044
|
-
});
|
|
1045
|
-
|
|
1046
|
-
var ReactShallowRenderer$3 = ( ReactShallowRenderer$2 && ReactShallowRenderer ) || ReactShallowRenderer$2;
|
|
1047
|
-
|
|
1048
1011
|
// TODO: decide on the top-level export form.
|
|
1049
1012
|
// This is hacky but makes it work with both Rollup and Jest.
|
|
1050
1013
|
|
|
1051
1014
|
|
|
1052
|
-
var shallow = ReactShallowRenderer
|
|
1015
|
+
var shallow = ReactShallowRenderer.default || ReactShallowRenderer;
|
|
1053
1016
|
|
|
1054
1017
|
module.exports = shallow;
|
|
1055
1018
|
})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.13.0
|
|
2
2
|
* react-test-renderer-shallow.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -7,28 +7,29 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
'use strict';var
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
function G(c){if(null==c)return null;if("function"===typeof c)return c.displayName||c.name||null;if("string"===typeof c)return c;switch(c){case v:return"Fragment";case u:return"Portal";case x:return"Profiler";case w:return"StrictMode";case B:return"Suspense";case C:return"SuspenseList"}if("object"===typeof c)switch(c.$$typeof){case z:return"Context.Consumer";case y:return"Context.Provider";case A:var d=c.render;d=d.displayName||d.name||"";return c.displayName||(""!==d?"ForwardRef("+d+")":"ForwardRef");
|
|
14
|
-
case
|
|
15
|
-
var L=
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
'use strict';var g=require("object-assign"),l=require("react"),m=require("react-is"),n=require("prop-types/checkPropTypes");function p(c){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+c,a=1;a<arguments.length;a++)d+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+c+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
|
|
11
|
+
var q=/^(.*)[\\\/]/,t="function"===typeof Symbol&&Symbol.for,u=t?Symbol.for("react.portal"):60106,v=t?Symbol.for("react.fragment"):60107,w=t?Symbol.for("react.strict_mode"):60108,x=t?Symbol.for("react.profiler"):60114,y=t?Symbol.for("react.provider"):60109,z=t?Symbol.for("react.context"):60110,A=t?Symbol.for("react.forward_ref"):60112,B=t?Symbol.for("react.suspense"):60113,C=t?Symbol.for("react.suspense_list"):60120,D=t?Symbol.for("react.memo"):60115,E=t?Symbol.for("react.lazy"):60116,F=t?Symbol.for("react.block"):
|
|
12
|
+
60121;
|
|
13
|
+
function G(c){if(null==c)return null;if("function"===typeof c)return c.displayName||c.name||null;if("string"===typeof c)return c;switch(c){case v:return"Fragment";case u:return"Portal";case x:return"Profiler";case w:return"StrictMode";case B:return"Suspense";case C:return"SuspenseList"}if("object"===typeof c)switch(c.$$typeof){case z:return"Context.Consumer";case y:return"Context.Provider";case A:var d=c.render;d=d.displayName||d.name||"";return c.displayName||(""!==d?"ForwardRef("+d+")":"ForwardRef");case D:return G(c.type);
|
|
14
|
+
case F:return G(c.render);case E:if(c=1===c._status?c._result:null)return G(c)}return null}function H(c,d){return c===d&&(0!==c||1/c===1/d)||c!==c&&d!==d}var I="function"===typeof Object.is?Object.is:H,J=Object.prototype.hasOwnProperty;function K(c,d){if(I(c,d))return!0;if("object"!==typeof c||null===c||"object"!==typeof d||null===d)return!1;var a=Object.keys(c),b=Object.keys(d);if(a.length!==b.length)return!1;for(b=0;b<a.length;b++)if(!J.call(d,a[b])||!I(c[a[b]],d[a[b]]))return!1;return!0}
|
|
15
|
+
var L=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;L.hasOwnProperty("ReactCurrentDispatcher")||(L.ReactCurrentDispatcher={current:null});L.hasOwnProperty("ReactCurrentBatchConfig")||(L.ReactCurrentBatchConfig={suspense:null});
|
|
16
|
+
var M=L.ReactCurrentDispatcher,N={},O=function(){function c(a){this._renderer=a;this._callbacks=[]}var d=c.prototype;d._enqueueCallback=function(a,b){"function"===typeof a&&b&&this._callbacks.push({callback:a,publicInstance:b})};d._invokeCallbacks=function(){var a=this._callbacks;this._callbacks=[];a.forEach(function(a){a.callback.call(a.publicInstance)})};d.isMounted=function(){return!!this._renderer._element};d.enqueueForceUpdate=function(a,b){this._enqueueCallback(b,a);this._renderer._forcedUpdate=
|
|
17
|
+
!0;this._renderer.render(this._renderer._element,this._renderer._context)};d.enqueueReplaceState=function(a,b,e){this._enqueueCallback(e,a);this._renderer._newState=b;this._renderer.render(this._renderer._element,this._renderer._context)};d.enqueueSetState=function(a,b,e){this._enqueueCallback(e,a);e=this._renderer._newState||a.state;"function"===typeof b&&(b=b.call(a,e,a.props));null!==b&&void 0!==b&&(this._renderer._newState=g({},e,{},b),this._renderer.render(this._renderer._element,this._renderer._context))};
|
|
18
|
+
return c}();function P(){return{memoizedState:null,queue:null,next:null}}function Q(c,d){return"function"===typeof d?d(c):d}
|
|
19
|
+
var T=function(){function c(){this._reset()}var d=c.prototype;d._reset=function(){this._rendered=this._newState=this._instance=this._element=this._context=null;this._forcedUpdate=this._rendering=!1;this._updater=new O(this);this._dispatcher=this._createDispatcher();this._firstWorkInProgressHook=this._workInProgressHook=null;this._didScheduleRenderPhaseUpdate=this._isReRender=!1;this._renderPhaseUpdates=null;this._numberOfReRenders=0};d._validateCurrentlyRenderingComponent=function(){if(!this._rendering||
|
|
19
20
|
this._instance)throw Error(p(321));};d._createDispatcher=function(){function a(){e._validateCurrentlyRenderingComponent()}function b(a,b,c){e._validateCurrentlyRenderingComponent();e._createWorkInProgressHook();var d=e._workInProgressHook;if(e._isReRender){c=d.queue;b=c.dispatch;if(0<e._numberOfReRenders){if(null!==e._renderPhaseUpdates){var f=e._renderPhaseUpdates.get(c);if(void 0!==f){e._renderPhaseUpdates.delete(c);c=d.memoizedState;do c=a(c,f.action),f=f.next;while(null!==f);d.memoizedState=c;
|
|
20
|
-
return[c,b]}}return[d.memoizedState,b]}f=d.memoizedState;var
|
|
21
|
+
return[c,b]}}return[d.memoizedState,b]}f=d.memoizedState;var r=c.first;if(null!==r){do f=a(f,r.action),r=r.next;while(null!==r);c.first=null;d.memoizedState=f}return[f,b]}a=a===Q?"function"===typeof b?b():b:void 0!==c?c(b):b;d.memoizedState=a;a=d.queue={first:null,dispatch:null};a=a.dispatch=e._dispatchAction.bind(e,a);return[d.memoizedState,a]}var e=this;return{readContext:function(a){return a._currentValue},useCallback:function(a){return a},useContext:function(a){e._validateCurrentlyRenderingComponent();
|
|
21
22
|
return a._currentValue},useDebugValue:a,useEffect:a,useImperativeHandle:a,useLayoutEffect:a,useMemo:function(a,b){e._validateCurrentlyRenderingComponent();e._createWorkInProgressHook();b=void 0!==b?b:null;if(null!==e._workInProgressHook&&null!==e._workInProgressHook.memoizedState){var c=e._workInProgressHook.memoizedState,d=c[1];if(null!==b){a:if(null===d)d=!1;else{for(var f=0;f<d.length&&f<b.length;f++)if(!I(b[f],d[f])){d=!1;break a}d=!0}if(d)return c[0]}}a=a();e._workInProgressHook.memoizedState=
|
|
22
|
-
[a,b];return a},useReducer:b,useRef:function(a){e._validateCurrentlyRenderingComponent();e._createWorkInProgressHook();var b=e._workInProgressHook.memoizedState;return null===b?(a={current:a},e._workInProgressHook.memoizedState=a):b},useState:function(a){return b(
|
|
23
|
+
[a,b];return a},useReducer:b,useRef:function(a){e._validateCurrentlyRenderingComponent();e._createWorkInProgressHook();var b=e._workInProgressHook.memoizedState;return null===b?(a={current:a},e._workInProgressHook.memoizedState=a):b},useState:function(a){return b(Q,a)},useResponder:function(a,b){return{props:b,responder:a}},useTransition:function(){e._validateCurrentlyRenderingComponent();return[function(a){a()},!1]},useDeferredValue:function(a){e._validateCurrentlyRenderingComponent();return a}}};
|
|
23
24
|
d._dispatchAction=function(a,b){if(!(25>this._numberOfReRenders))throw Error(p(301));if(this._rendering){this._didScheduleRenderPhaseUpdate=!0;b={action:b,next:null};var e=this._renderPhaseUpdates;null===e&&(this._renderPhaseUpdates=e=new Map);var c=e.get(a);if(void 0===c)e.set(a,b);else{for(a=c;null!==a.next;)a=a.next;a.next=b}}else{b={action:b,next:null};e=a.first;if(null===e)a.first=b;else{for(;null!==e.next;)e=e.next;e.next=b}this.render(this._element,this._context)}};d._createWorkInProgressHook=
|
|
24
|
-
function(){null===this._workInProgressHook?null===this._firstWorkInProgressHook?(this._isReRender=!1,this._firstWorkInProgressHook=this._workInProgressHook=
|
|
25
|
-
(this._didScheduleRenderPhaseUpdate=!1,this._numberOfReRenders+=1,this._workInProgressHook=null,this._rendering=!1,this.render(a,b)):(this._renderPhaseUpdates=this._workInProgressHook=null,this._numberOfReRenders=0)};d.getMountedInstance=function(){return this._instance};d.getRenderOutput=function(){return this._rendered};d.render=function(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:
|
|
26
|
-
""));if("string"===typeof a.type)throw Error(p(13,a.type));if(!m.isForwardRef(a)&&"function"!==typeof a.type&&!m.isMemo(a))throw Error(p(249,Array.isArray(a.type)?"array":null===a.type?"null":typeof a.type));if(!this._rendering){null!=this._element&&this._element.type!==a.type&&this._reset();var e=m.isMemo(a)?a.type.type:a.type,c=this._element;this._rendering=!0;this._element=a;var d;if((d=e.contextTypes)&&b){var k={},
|
|
27
|
-
a,n(e.propTypes,a.props,"prop",G(e),
|
|
28
|
-
b&&b.displayName||e.name||b&&b.name||null,
|
|
25
|
+
function(){null===this._workInProgressHook?null===this._firstWorkInProgressHook?(this._isReRender=!1,this._firstWorkInProgressHook=this._workInProgressHook=P()):(this._isReRender=!0,this._workInProgressHook=this._firstWorkInProgressHook):null===this._workInProgressHook.next?(this._isReRender=!1,this._workInProgressHook=this._workInProgressHook.next=P()):(this._isReRender=!0,this._workInProgressHook=this._workInProgressHook.next);return this._workInProgressHook};d._finishHooks=function(a,b){this._didScheduleRenderPhaseUpdate?
|
|
26
|
+
(this._didScheduleRenderPhaseUpdate=!1,this._numberOfReRenders+=1,this._workInProgressHook=null,this._rendering=!1,this.render(a,b)):(this._renderPhaseUpdates=this._workInProgressHook=null,this._numberOfReRenders=0)};d.getMountedInstance=function(){return this._instance};d.getRenderOutput=function(){return this._rendered};d.render=function(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:N;if(!l.isValidElement(a))throw Error(p(12,"function"===typeof a?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":
|
|
27
|
+
""));if("string"===typeof a.type)throw Error(p(13,a.type));if(!m.isForwardRef(a)&&"function"!==typeof a.type&&!m.isMemo(a))throw Error(p(249,Array.isArray(a.type)?"array":null===a.type?"null":typeof a.type));if(!this._rendering){null!=this._element&&this._element.type!==a.type&&this._reset();var e=m.isMemo(a)?a.type.type:a.type,c=this._element;this._rendering=!0;this._element=a;var d;if((d=e.contextTypes)&&b){var k={},h;for(h in d)k[h]=b[h];d=k}else d=N;this._context=d;m.isMemo(a)&&e.propTypes&&(R=
|
|
28
|
+
a,n(e.propTypes,a.props,"prop",G(e),S));if(this._instance)this._updateClassComponent(e,a,this._context);else if(e.prototype&&e.prototype.isReactComponent)this._instance=new e(a.props,this._context,this._updater),"function"===typeof e.getDerivedStateFromProps&&(b=e.getDerivedStateFromProps.call(null,a.props,this._instance.state),null!=b&&(this._instance.state=g({},this._instance.state,b))),e.contextTypes&&(R=a,b=(b=this._instance)&&b.constructor,n(e.contextTypes,this._context,"context",e.displayName||
|
|
29
|
+
b&&b.displayName||e.name||b&&b.name||null,S),R=null),this._mountClassComponent(e,a,this._context);else if(d=!0,m.isMemo(a)&&null!==c&&(a.type.compare||K)(c.props,a.props)&&(d=!1),d){c=M.current;M.current=this._dispatcher;try{if(e.$$typeof===m.ForwardRef){if("function"!==typeof e.render)throw Error(p(322,typeof e.render));this._rendered=e.render.call(void 0,a.props,a.ref)}else this._rendered=e(a.props,this._context)}finally{M.current=c}this._finishHooks(a,b)}this._rendering=!1;this._updater._invokeCallbacks();
|
|
29
30
|
return this.getRenderOutput()}};d.unmount=function(){this._instance&&"function"===typeof this._instance.componentWillUnmount&&this._instance.componentWillUnmount();this._reset()};d._mountClassComponent=function(a,b,c){this._instance.context=c;this._instance.props=b.props;this._instance.state=this._instance.state||null;this._instance.updater=this._updater;if("function"===typeof this._instance.UNSAFE_componentWillMount||"function"===typeof this._instance.componentWillMount)b=this._newState,"function"!==
|
|
30
|
-
typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillMount&&this._instance.componentWillMount(),"function"===typeof this._instance.UNSAFE_componentWillMount&&this._instance.UNSAFE_componentWillMount()),b!==this._newState&&(this._instance.state=this._newState||
|
|
31
|
-
b&&"function"!==typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillReceiveProps&&this._instance.componentWillReceiveProps(b,c),"function"===typeof this._instance.UNSAFE_componentWillReceiveProps&&this._instance.UNSAFE_componentWillReceiveProps(b,c));var k=this._newState||d;if("function"===typeof a.getDerivedStateFromProps){var
|
|
32
|
-
(
|
|
33
|
-
k,c));this._instance.context=c;this._instance.props=b;this._instance.state=k;this._newState=null;
|
|
34
|
-
function
|
|
31
|
+
typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillMount&&this._instance.componentWillMount(),"function"===typeof this._instance.UNSAFE_componentWillMount&&this._instance.UNSAFE_componentWillMount()),b!==this._newState&&(this._instance.state=this._newState||N);this._rendered=this._instance.render()};d._updateClassComponent=function(a,b,c){b=b.props;var d=this._instance.state||N,e=this._instance.props;e!==
|
|
32
|
+
b&&"function"!==typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillReceiveProps&&this._instance.componentWillReceiveProps(b,c),"function"===typeof this._instance.UNSAFE_componentWillReceiveProps&&this._instance.UNSAFE_componentWillReceiveProps(b,c));var k=this._newState||d;if("function"===typeof a.getDerivedStateFromProps){var h=a.getDerivedStateFromProps.call(null,b,k);null!=h&&(k=g({},k,h))}h=!0;this._forcedUpdate?
|
|
33
|
+
(h=!0,this._forcedUpdate=!1):"function"===typeof this._instance.shouldComponentUpdate?h=!!this._instance.shouldComponentUpdate(b,k,c):a.prototype&&a.prototype.isPureReactComponent&&(h=!K(e,b)||!K(d,k));h&&"function"!==typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillUpdate&&this._instance.componentWillUpdate(b,k,c),"function"===typeof this._instance.UNSAFE_componentWillUpdate&&this._instance.UNSAFE_componentWillUpdate(b,
|
|
34
|
+
k,c));this._instance.context=c;this._instance.props=b;this._instance.state=k;this._newState=null;h&&(this._rendered=this._instance.render())};return c}();T.createRenderer=function(){return new T};var R=null;function U(c){if(null==c)return"#empty";if("string"===typeof c||"number"===typeof c)return"#text";if("string"===typeof c.type)return c.type;c=m.isMemo(c)?c.type.type:c.type;return c.displayName||c.name||"Unknown"}
|
|
35
|
+
function S(){var c="";if(R){var d=U(R),a=R._owner,b=R._source;a=a&&G(a.type);var e="";b?e=" (at "+b.fileName.replace(q,"")+":"+b.lineNumber+")":a&&(e=" (created by "+a+")");c+="\n in "+(d||"Unknown")+e}return c}module.exports=T.default||T;
|