react-test-renderer 16.6.0-alpha.8af6728 → 16.6.3
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/react-test-renderer-shallow.development.js +30 -62
- package/cjs/react-test-renderer-shallow.production.min.js +14 -14
- package/cjs/react-test-renderer.development.js +2390 -1081
- package/cjs/react-test-renderer.production.min.js +135 -129
- package/package.json +23 -6
- package/umd/react-test-renderer-shallow.development.js +32 -63
- package/umd/react-test-renderer-shallow.production.min.js +14 -14
- package/umd/react-test-renderer.development.js +2395 -1079
- package/umd/react-test-renderer.production.min.js +114 -110
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-test-renderer",
|
|
3
|
-
"version": "16.6.
|
|
3
|
+
"version": "16.6.3",
|
|
4
4
|
"description": "React package for snapshot testing.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": "facebook/react",
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"object-assign": "^4.1.1",
|
|
19
19
|
"prop-types": "^15.6.2",
|
|
20
|
-
"react-is": "^16.6.
|
|
21
|
-
"scheduler": "^0.
|
|
20
|
+
"react-is": "^16.6.3",
|
|
21
|
+
"scheduler": "^0.11.2"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"react": "^16.
|
|
24
|
+
"react": "^16.6.3"
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
27
|
"LICENSE",
|
|
@@ -30,5 +30,22 @@
|
|
|
30
30
|
"shallow.js",
|
|
31
31
|
"cjs/",
|
|
32
32
|
"umd/"
|
|
33
|
-
]
|
|
34
|
-
|
|
33
|
+
],
|
|
34
|
+
"buildInfo": {
|
|
35
|
+
"buildID": "0c756fb-f7f79fd",
|
|
36
|
+
"checksum": "d94496cd35663b7e3250c3d4a9069d8229b72b27",
|
|
37
|
+
"unstable": false,
|
|
38
|
+
"partial": false,
|
|
39
|
+
"packages": [
|
|
40
|
+
"create-subscription",
|
|
41
|
+
"jest-react",
|
|
42
|
+
"react",
|
|
43
|
+
"react-art",
|
|
44
|
+
"react-dom",
|
|
45
|
+
"react-is",
|
|
46
|
+
"react-reconciler",
|
|
47
|
+
"react-test-renderer",
|
|
48
|
+
"scheduler"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.6.
|
|
1
|
+
/** @license React v16.6.1
|
|
2
2
|
* react-test-renderer-shallow.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -75,9 +75,12 @@ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeac
|
|
|
75
75
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
76
76
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
77
77
|
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
|
78
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
78
79
|
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
79
80
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
80
81
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
82
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
83
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
81
84
|
|
|
82
85
|
/**
|
|
83
86
|
* Forked from fbjs/warning:
|
|
@@ -106,6 +109,7 @@ function typeOf(object) {
|
|
|
106
109
|
var type = object.type;
|
|
107
110
|
|
|
108
111
|
switch (type) {
|
|
112
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
109
113
|
case REACT_CONCURRENT_MODE_TYPE:
|
|
110
114
|
case REACT_FRAGMENT_TYPE:
|
|
111
115
|
case REACT_PROFILER_TYPE:
|
|
@@ -131,7 +135,7 @@ function typeOf(object) {
|
|
|
131
135
|
return undefined;
|
|
132
136
|
}
|
|
133
137
|
|
|
134
|
-
// AsyncMode
|
|
138
|
+
// AsyncMode is deprecated along with isAsyncMode
|
|
135
139
|
|
|
136
140
|
|
|
137
141
|
|
|
@@ -207,63 +211,24 @@ var warningWithoutStack = function () {};
|
|
|
207
211
|
return;
|
|
208
212
|
}
|
|
209
213
|
if (typeof console !== 'undefined') {
|
|
210
|
-
var
|
|
214
|
+
var argsWithFormat = args.map(function (item) {
|
|
211
215
|
return '' + item;
|
|
212
|
-
})
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
f = _args$map[5],
|
|
219
|
-
g = _args$map[6],
|
|
220
|
-
h = _args$map[7];
|
|
221
|
-
|
|
222
|
-
var message = 'Warning: ' + format;
|
|
223
|
-
|
|
224
|
-
// We intentionally don't use spread (or .apply) because it breaks IE9:
|
|
225
|
-
// https://github.com/facebook/react/issues/13610
|
|
226
|
-
switch (args.length) {
|
|
227
|
-
case 0:
|
|
228
|
-
console.error(message);
|
|
229
|
-
break;
|
|
230
|
-
case 1:
|
|
231
|
-
console.error(message, a);
|
|
232
|
-
break;
|
|
233
|
-
case 2:
|
|
234
|
-
console.error(message, a, b);
|
|
235
|
-
break;
|
|
236
|
-
case 3:
|
|
237
|
-
console.error(message, a, b, c);
|
|
238
|
-
break;
|
|
239
|
-
case 4:
|
|
240
|
-
console.error(message, a, b, c, d);
|
|
241
|
-
break;
|
|
242
|
-
case 5:
|
|
243
|
-
console.error(message, a, b, c, d, e);
|
|
244
|
-
break;
|
|
245
|
-
case 6:
|
|
246
|
-
console.error(message, a, b, c, d, e, f);
|
|
247
|
-
break;
|
|
248
|
-
case 7:
|
|
249
|
-
console.error(message, a, b, c, d, e, f, g);
|
|
250
|
-
break;
|
|
251
|
-
case 8:
|
|
252
|
-
console.error(message, a, b, c, d, e, f, g, h);
|
|
253
|
-
break;
|
|
254
|
-
default:
|
|
255
|
-
throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
|
|
256
|
-
}
|
|
216
|
+
});
|
|
217
|
+
argsWithFormat.unshift('Warning: ' + format);
|
|
218
|
+
|
|
219
|
+
// We intentionally don't use spread (or .apply) directly because it
|
|
220
|
+
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
221
|
+
Function.prototype.apply.call(console.error, console, argsWithFormat);
|
|
257
222
|
}
|
|
258
223
|
try {
|
|
259
224
|
// --- Welcome to debugging React ---
|
|
260
225
|
// This error was thrown as a convenience so that you can use this stack
|
|
261
226
|
// to find the callsite that caused this warning to fire.
|
|
262
227
|
var argIndex = 0;
|
|
263
|
-
var
|
|
228
|
+
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
264
229
|
return args[argIndex++];
|
|
265
230
|
});
|
|
266
|
-
throw new Error(
|
|
231
|
+
throw new Error(message);
|
|
267
232
|
} catch (x) {}
|
|
268
233
|
};
|
|
269
234
|
}
|
|
@@ -273,10 +238,13 @@ var warningWithoutStack$1 = warningWithoutStack;
|
|
|
273
238
|
var Resolved = 1;
|
|
274
239
|
|
|
275
240
|
|
|
241
|
+
function refineResolvedLazyComponent(lazyComponent) {
|
|
242
|
+
return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
|
243
|
+
}
|
|
276
244
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
return
|
|
245
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
246
|
+
var functionName = innerType.displayName || innerType.name || '';
|
|
247
|
+
return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
|
|
280
248
|
}
|
|
281
249
|
|
|
282
250
|
function getComponentName(type) {
|
|
@@ -316,16 +284,17 @@ function getComponentName(type) {
|
|
|
316
284
|
case REACT_PROVIDER_TYPE:
|
|
317
285
|
return 'Context.Provider';
|
|
318
286
|
case REACT_FORWARD_REF_TYPE:
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
return type.
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
287
|
+
return getWrappedName(type, type.render, 'ForwardRef');
|
|
288
|
+
case REACT_MEMO_TYPE:
|
|
289
|
+
return getComponentName(type.type);
|
|
290
|
+
case REACT_LAZY_TYPE:
|
|
291
|
+
{
|
|
292
|
+
var thenable = type;
|
|
293
|
+
var resolvedThenable = refineResolvedLazyComponent(thenable);
|
|
294
|
+
if (resolvedThenable) {
|
|
295
|
+
return getComponentName(resolvedThenable);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
329
298
|
}
|
|
330
299
|
}
|
|
331
300
|
return null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.6.
|
|
1
|
+
/** @license React v16.6.1
|
|
2
2
|
* react-test-renderer-shallow.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -7,16 +7,16 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
'use strict';(function(g,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e(require("react")):"function"===typeof define&&define.amd?define(["react"],e):g.ReactShallowRenderer=e(g.React)})(this,function(g){function e(a,b,f,d,c,h,g,x){if(!a){a=void 0;if(void 0===b)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var w=[f,d,c,h,g,x],e=0;a=Error(b.replace(/%s/g,function(){return w[e++]}));
|
|
10
|
-
a.name="Invariant Violation"}a.framesToPop=1;throw a;}}function n(a){for(var b=arguments.length-1,f="https://reactjs.org/docs/error-decoder.html?invariant="+a,d=0;d<b;d++)f+="&args[]="+encodeURIComponent(arguments[d+1]);e(!1,"Minified React error #"+a+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",f)}function q(a){if("object"===typeof a&&null!==a){var b=a.$$typeof;switch(b){case y:switch(a=a.type,a){case z:case A:case B:case C:return a;
|
|
11
|
-
default:switch(a=a&&a.$$typeof,a){case
|
|
12
|
-
}var v=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,c="function"===typeof Symbol&&Symbol.for,y=c?Symbol.for("react.element"):60103,
|
|
13
|
-
Object.prototype.hasOwnProperty,l={},
|
|
14
|
-
b);this._renderer._forcedUpdate=!0;this._renderer.render(this._renderer._element,this._renderer._context)};a.prototype.enqueueReplaceState=function(b,a,d,c){this._enqueueCallback(d,b);this._renderer._newState=a;this._renderer.render(this._renderer._element,this._renderer._context)};a.prototype.enqueueSetState=function(b,a,d,c){this._enqueueCallback(d,b);d=this._renderer._newState||b.state;"function"===typeof a&&(a=a.call(b,d,b.props));
|
|
15
|
-
this._renderer._context))};return a}(),m=function(){function a(){u(this,a);this._rendered=this._newState=this._instance=this._element=this._context=null;this._forcedUpdate=this._rendering=!1;this._updater=new
|
|
16
|
-
"");"string"===typeof b.type?n("13",b.type):void 0;q(b)!==p&&"function"!==typeof b.type?n("249",Array.isArray(b.type)?"array":null===b.type?"null":typeof b.type):void 0;if(!this._rendering){this._rendering=!0;this._element=b;var d=b.type.contextTypes;if(d){var c={},h;for(h in d)c[h]=a[h];a=c}else a=l;
|
|
17
|
-
this._context,this._updater),this._updateStateFromStaticLifecycle(b.props),b.type.hasOwnProperty("contextTypes"),this._mountClassComponent(b,this._context)):this._rendered=b.type.call(void 0,b.props,this._context));this._rendering=!1;this._updater._invokeCallbacks();return this.getRenderOutput()}};
|
|
18
|
-
null};a.prototype._mountClassComponent=function(b,a){this._instance.context=a;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)a=
|
|
19
|
-
"function"===typeof this._instance.UNSAFE_componentWillMount&&this._instance.UNSAFE_componentWillMount()),a!==this._newState&&(this._instance.state=this._newState||l);this._rendered=this._instance.render()};a.prototype._updateClassComponent=function(a,c){var b=a.props,f=a.type,h=this._instance.state||
|
|
20
|
-
this._instance.componentWillReceiveProps(b,c),"function"===typeof this._instance.UNSAFE_componentWillReceiveProps&&this._instance.UNSAFE_componentWillReceiveProps(b,c));this._updateStateFromStaticLifecycle(b);var e=this._newState||h,k=!0;this._forcedUpdate?(k=!0,this._forcedUpdate=!1):"function"===
|
|
21
|
-
"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillUpdate&&this._instance.componentWillUpdate(b,e,c),"function"===typeof this._instance.UNSAFE_componentWillUpdate&&this._instance.UNSAFE_componentWillUpdate(b,e,c));this._instance.context=
|
|
22
|
-
this._newState||this._instance.state;a=b.getDerivedStateFromProps.call(null,a,c);null!=a&&(c=v({},c,a),this._instance.state=this._newState=c)}};return a}();m.createRenderer=function(){return new m};c=(c={default:m},m)||c;return c.default||c});
|
|
10
|
+
a.name="Invariant Violation"}a.framesToPop=1;throw a;}}function n(a){for(var b=arguments.length-1,f="https://reactjs.org/docs/error-decoder.html?invariant="+a,d=0;d<b;d++)f+="&args[]="+encodeURIComponent(arguments[d+1]);e(!1,"Minified React error #"+a+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",f)}function q(a){if("object"===typeof a&&null!==a){var b=a.$$typeof;switch(b){case y:switch(a=a.type,a){case z:case A:case B:case C:case D:return a;
|
|
11
|
+
default:switch(a=a&&a.$$typeof,a){case E:case p:case F:return a;default:return b}}case G:return b}}}function r(a,b){return a===b?0!==a||0!==b||1/a===1/b:a!==a&&b!==b}function t(a,b){if(r(a,b))return!0;if("object"!==typeof a||null===a||"object"!==typeof b||null===b)return!1;var f=Object.keys(a),d=Object.keys(b);if(f.length!==d.length)return!1;for(d=0;d<f.length;d++)if(!H.call(b,f[d])||!r(a[f[d]],b[f[d]]))return!1;return!0}function u(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");
|
|
12
|
+
}var v=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,c="function"===typeof Symbol&&Symbol.for,y=c?Symbol.for("react.element"):60103,G=c?Symbol.for("react.portal"):60106,B=c?Symbol.for("react.fragment"):60107,D=c?Symbol.for("react.strict_mode"):60108,C=c?Symbol.for("react.profiler"):60114,F=c?Symbol.for("react.provider"):60109,E=c?Symbol.for("react.context"):60110,z=c?Symbol.for("react.async_mode"):60111,A=c?Symbol.for("react.concurrent_mode"):60111,p=c?Symbol.for("react.forward_ref"):
|
|
13
|
+
60112;c&&Symbol.for("react.suspense");c&&Symbol.for("react.memo");c&&Symbol.for("react.lazy");var H=Object.prototype.hasOwnProperty,l={},I=function(){function a(b){u(this,a);this._renderer=b;this._callbacks=[]}a.prototype._enqueueCallback=function(b,a){"function"===typeof b&&a&&this._callbacks.push({callback:b,publicInstance:a})};a.prototype._invokeCallbacks=function(){var b=this._callbacks;this._callbacks=[];b.forEach(function(b){b.callback.call(b.publicInstance)})};a.prototype.isMounted=function(b){return!!this._renderer._element};
|
|
14
|
+
a.prototype.enqueueForceUpdate=function(b,a,d){this._enqueueCallback(a,b);this._renderer._forcedUpdate=!0;this._renderer.render(this._renderer._element,this._renderer._context)};a.prototype.enqueueReplaceState=function(b,a,d,c){this._enqueueCallback(d,b);this._renderer._newState=a;this._renderer.render(this._renderer._element,this._renderer._context)};a.prototype.enqueueSetState=function(b,a,d,c){this._enqueueCallback(d,b);d=this._renderer._newState||b.state;"function"===typeof a&&(a=a.call(b,d,b.props));
|
|
15
|
+
null!==a&&void 0!==a&&(this._renderer._newState=v({},d,a),this._renderer.render(this._renderer._element,this._renderer._context))};return a}(),m=function(){function a(){u(this,a);this._rendered=this._newState=this._instance=this._element=this._context=null;this._forcedUpdate=this._rendering=!1;this._updater=new I(this)}a.prototype.getMountedInstance=function(){return this._instance};a.prototype.getRenderOutput=function(){return this._rendered};a.prototype.render=function(b){var a=1<arguments.length&&
|
|
16
|
+
void 0!==arguments[1]?arguments[1]:l;g.isValidElement(b)?void 0:n("12","function"===typeof b?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":"");"string"===typeof b.type?n("13",b.type):void 0;q(b)!==p&&"function"!==typeof b.type?n("249",Array.isArray(b.type)?"array":null===b.type?"null":typeof b.type):void 0;if(!this._rendering){this._rendering=!0;this._element=b;var d=b.type.contextTypes;if(d){var c={},h;for(h in d)c[h]=a[h];a=c}else a=l;
|
|
17
|
+
this._context=a;this._instance?this._updateClassComponent(b,this._context):q(b)===p?this._rendered=b.type.render(b.props,b.ref):(a=b.type,a.prototype&&a.prototype.isReactComponent?(this._instance=new b.type(b.props,this._context,this._updater),this._updateStateFromStaticLifecycle(b.props),b.type.hasOwnProperty("contextTypes"),this._mountClassComponent(b,this._context)):this._rendered=b.type.call(void 0,b.props,this._context));this._rendering=!1;this._updater._invokeCallbacks();return this.getRenderOutput()}};
|
|
18
|
+
a.prototype.unmount=function(){this._instance&&"function"===typeof this._instance.componentWillUnmount&&this._instance.componentWillUnmount();this._instance=this._rendered=this._newState=this._element=this._context=null};a.prototype._mountClassComponent=function(b,a){this._instance.context=a;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)a=
|
|
19
|
+
this._newState,"function"!==typeof b.type.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillMount&&this._instance.componentWillMount(),"function"===typeof this._instance.UNSAFE_componentWillMount&&this._instance.UNSAFE_componentWillMount()),a!==this._newState&&(this._instance.state=this._newState||l);this._rendered=this._instance.render()};a.prototype._updateClassComponent=function(a,c){var b=a.props,f=a.type,h=this._instance.state||
|
|
20
|
+
l,g=this._instance.props;g!==b&&"function"!==typeof a.type.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));this._updateStateFromStaticLifecycle(b);var e=this._newState||h,k=!0;this._forcedUpdate?(k=!0,this._forcedUpdate=!1):"function"===
|
|
21
|
+
typeof this._instance.shouldComponentUpdate?k=!!this._instance.shouldComponentUpdate(b,e,c):f.prototype&&f.prototype.isPureReactComponent&&(k=!t(g,b)||!t(h,e));k&&"function"!==typeof a.type.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillUpdate&&this._instance.componentWillUpdate(b,e,c),"function"===typeof this._instance.UNSAFE_componentWillUpdate&&this._instance.UNSAFE_componentWillUpdate(b,e,c));this._instance.context=
|
|
22
|
+
c;this._instance.props=b;this._instance.state=e;k&&(this._rendered=this._instance.render())};a.prototype._updateStateFromStaticLifecycle=function(a){var b=this._element.type;if("function"===typeof b.getDerivedStateFromProps){var c=this._newState||this._instance.state;a=b.getDerivedStateFromProps.call(null,a,c);null!=a&&(c=v({},c,a),this._instance.state=this._newState=c)}};return a}();m.createRenderer=function(){return new m};c=(c={default:m},m)||c;return c.default||c});
|