react-test-renderer 16.6.0-alpha.8af6728 → 16.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/react-test-renderer-shallow.development.js +20 -14
- package/cjs/react-test-renderer-shallow.production.min.js +14 -14
- package/cjs/react-test-renderer.development.js +1073 -585
- package/cjs/react-test-renderer.production.min.js +132 -127
- package/package.json +4 -4
- package/umd/react-test-renderer-shallow.development.js +20 -14
- package/umd/react-test-renderer-shallow.production.min.js +12 -12
- package/umd/react-test-renderer.development.js +1073 -585
- package/umd/react-test-renderer.production.min.js +114 -110
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.6.0
|
|
1
|
+
/** @license React v16.6.0
|
|
2
2
|
* react-test-renderer-shallow.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -196,14 +196,19 @@ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
|
|
196
196
|
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
197
197
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
198
198
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
199
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
200
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
199
201
|
|
|
200
202
|
var Resolved = 1;
|
|
201
203
|
|
|
202
204
|
|
|
205
|
+
function refineResolvedLazyComponent(lazyComponent) {
|
|
206
|
+
return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
|
207
|
+
}
|
|
203
208
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
return
|
|
209
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
210
|
+
var functionName = innerType.displayName || innerType.name || '';
|
|
211
|
+
return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
|
|
207
212
|
}
|
|
208
213
|
|
|
209
214
|
function getComponentName(type) {
|
|
@@ -243,16 +248,17 @@ function getComponentName(type) {
|
|
|
243
248
|
case REACT_PROVIDER_TYPE:
|
|
244
249
|
return 'Context.Provider';
|
|
245
250
|
case REACT_FORWARD_REF_TYPE:
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
return type.
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
251
|
+
return getWrappedName(type, type.render, 'ForwardRef');
|
|
252
|
+
case REACT_MEMO_TYPE:
|
|
253
|
+
return getComponentName(type.type);
|
|
254
|
+
case REACT_LAZY_TYPE:
|
|
255
|
+
{
|
|
256
|
+
var thenable = type;
|
|
257
|
+
var resolvedThenable = refineResolvedLazyComponent(thenable);
|
|
258
|
+
if (resolvedThenable) {
|
|
259
|
+
return getComponentName(resolvedThenable);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
256
262
|
}
|
|
257
263
|
}
|
|
258
264
|
return null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.6.0
|
|
1
|
+
/** @license React v16.6.0
|
|
2
2
|
* react-test-renderer-shallow.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -9,18 +9,18 @@
|
|
|
9
9
|
|
|
10
10
|
'use strict';var e=require("object-assign"),g=require("react"),n=require("react-is"),p=require("prop-types/checkPropTypes");function q(a,b,d,c,f,h,m,k){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 l=[d,c,f,h,m,k],D=0;a=Error(b.replace(/%s/g,function(){return l[D++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}}
|
|
11
11
|
function r(a){for(var b=arguments.length-1,d="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;c<b;c++)d+="&args[]="+encodeURIComponent(arguments[c+1]);q(!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. ",d)}
|
|
12
|
-
var t=/^(.*)[\\\/]/,u="function"===typeof Symbol&&Symbol.for,v=u?Symbol.for("react.portal"):60106,w=u?Symbol.for("react.fragment"):60107,x=u?Symbol.for("react.strict_mode"):60108,y=u?Symbol.for("react.profiler"):60114,z=u?Symbol.for("react.provider"):60109,A=u?Symbol.for("react.context"):60110,B=u?Symbol.for("react.concurrent_mode"):60111,C=u?Symbol.for("react.forward_ref"):60112,E=u?Symbol.for("react.suspense"):60113;
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
var
|
|
12
|
+
var t=/^(.*)[\\\/]/,u="function"===typeof Symbol&&Symbol.for,v=u?Symbol.for("react.portal"):60106,w=u?Symbol.for("react.fragment"):60107,x=u?Symbol.for("react.strict_mode"):60108,y=u?Symbol.for("react.profiler"):60114,z=u?Symbol.for("react.provider"):60109,A=u?Symbol.for("react.context"):60110,B=u?Symbol.for("react.concurrent_mode"):60111,C=u?Symbol.for("react.forward_ref"):60112,E=u?Symbol.for("react.suspense"):60113,F=u?Symbol.for("react.memo"):60115,G=u?Symbol.for("react.lazy"):60116;
|
|
13
|
+
function H(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case B:return"ConcurrentMode";case w:return"Fragment";case v:return"Portal";case y:return"Profiler";case x:return"StrictMode";case E:return"Suspense"}if("object"===typeof a)switch(a.$$typeof){case A:return"Context.Consumer";case z:return"Context.Provider";case C:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+")":"ForwardRef");
|
|
14
|
+
case F:return H(a.type);case G:if(a=1===a._status?a._result:null)return H(a)}return null}var I=Object.prototype.hasOwnProperty;function J(a,b){return a===b?0!==a||0!==b||1/a===1/b:a!==a&&b!==b}function K(a,b){if(J(a,b))return!0;if("object"!==typeof a||null===a||"object"!==typeof b||null===b)return!1;var d=Object.keys(a),c=Object.keys(b);if(d.length!==c.length)return!1;for(c=0;c<d.length;c++)if(!I.call(b,d[c])||!J(a[d[c]],b[d[c]]))return!1;return!0}
|
|
15
|
+
function L(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}
|
|
16
|
+
var M={},N=function(){function a(b){L(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(){return!!this._renderer._element};a.prototype.enqueueForceUpdate=function(b,a){this._enqueueCallback(a,b);this._renderer._forcedUpdate=
|
|
17
17
|
!0;this._renderer.render(this._renderer._element,this._renderer._context)};a.prototype.enqueueReplaceState=function(b,a,c){this._enqueueCallback(c,b);this._renderer._newState=a;this._renderer.render(this._renderer._element,this._renderer._context)};a.prototype.enqueueSetState=function(b,a,c){this._enqueueCallback(c,b);c=this._renderer._newState||b.state;"function"===typeof a&&(a=a.call(b,c,b.props));null!==a&&void 0!==a&&(this._renderer._newState=e({},c,a),this._renderer.render(this._renderer._element,
|
|
18
|
-
this._renderer._context))};return a}(),
|
|
19
|
-
"");"string"===typeof b.type?r("13",b.type):void 0;n.isForwardRef(b)||"function"===typeof b.type?void 0:r("249",Array.isArray(b.type)?"array":null===b.type?"null":typeof b.type);if(!this._rendering){this._rendering=!0;this._element=b;var c=b.type.contextTypes;if(c){var f={},h;for(h in c)f[h]=a[h];a=f}else a=
|
|
20
|
-
new b.type(b.props,this._context,this._updater),this._updateStateFromStaticLifecycle(b.props),b.type.hasOwnProperty("contextTypes")&&(
|
|
18
|
+
this._renderer._context))};return a}(),Q=function(){function a(){L(this,a);this._rendered=this._newState=this._instance=this._element=this._context=null;this._forcedUpdate=this._rendering=!1;this._updater=new N(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&&void 0!==arguments[1]?arguments[1]:M;g.isValidElement(b)?void 0:r("12","function"===typeof b?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":
|
|
19
|
+
"");"string"===typeof b.type?r("13",b.type):void 0;n.isForwardRef(b)||"function"===typeof b.type?void 0:r("249",Array.isArray(b.type)?"array":null===b.type?"null":typeof b.type);if(!this._rendering){this._rendering=!0;this._element=b;var c=b.type.contextTypes;if(c){var f={},h;for(h in c)f[h]=a[h];a=f}else a=M;this._context=a;this._instance?this._updateClassComponent(b,this._context):n.isForwardRef(b)?this._rendered=b.type.render(b.props,b.ref):(a=b.type,a.prototype&&a.prototype.isReactComponent?(this._instance=
|
|
20
|
+
new b.type(b.props,this._context,this._updater),this._updateStateFromStaticLifecycle(b.props),b.type.hasOwnProperty("contextTypes")&&(O=b,a=b.type,c=(c=this._instance)&&c.constructor,p(b.type.contextTypes,this._context,"context",a.displayName||c&&c.displayName||a.name||c&&c.name||null,P),O=null),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()}};a.prototype.unmount=
|
|
21
21
|
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(a,d){this._instance.context=d;this._instance.props=a.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)d=
|
|
22
|
-
this._newState,"function"!==typeof a.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()),d!==this._newState&&(this._instance.state=this._newState||
|
|
23
|
-
|
|
24
|
-
typeof this._instance.shouldComponentUpdate?l=!!this._instance.shouldComponentUpdate(b,k,d):f.prototype&&f.prototype.isPureReactComponent&&(l=!
|
|
25
|
-
d;this._instance.props=b;this._instance.state=k;l&&(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=e({},c,a),this._instance.state=this._newState=c)}};return a}();
|
|
26
|
-
function
|
|
22
|
+
this._newState,"function"!==typeof a.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()),d!==this._newState&&(this._instance.state=this._newState||M);this._rendered=this._instance.render()};a.prototype._updateClassComponent=function(a,d){var b=a.props,f=a.type,h=this._instance.state||
|
|
23
|
+
M,m=this._instance.props;m!==b&&"function"!==typeof a.type.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillReceiveProps&&this._instance.componentWillReceiveProps(b,d),"function"===typeof this._instance.UNSAFE_componentWillReceiveProps&&this._instance.UNSAFE_componentWillReceiveProps(b,d));this._updateStateFromStaticLifecycle(b);var k=this._newState||h,l=!0;this._forcedUpdate?(l=!0,this._forcedUpdate=!1):"function"===
|
|
24
|
+
typeof this._instance.shouldComponentUpdate?l=!!this._instance.shouldComponentUpdate(b,k,d):f.prototype&&f.prototype.isPureReactComponent&&(l=!K(m,b)||!K(h,k));l&&"function"!==typeof a.type.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillUpdate&&this._instance.componentWillUpdate(b,k,d),"function"===typeof this._instance.UNSAFE_componentWillUpdate&&this._instance.UNSAFE_componentWillUpdate(b,k,d));this._instance.context=
|
|
25
|
+
d;this._instance.props=b;this._instance.state=k;l&&(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=e({},c,a),this._instance.state=this._newState=c)}};return a}();Q.createRenderer=function(){return new Q};var O=null;
|
|
26
|
+
function P(){var a="";if(O){var b=null==O?"#empty":"string"===typeof O||"number"===typeof O?"#text":"string"===typeof O.type?O.type:O.type.displayName||O.type.name||"Unknown",d=O._owner,c=O._source;d=d&&H(d.type);var f="";c?f=" (at "+c.fileName.replace(t,"")+":"+c.lineNumber+")":d&&(f=" (created by "+d+")");a+="\n in "+(b||"Unknown")+f}return a}var R={default:Q},S=R&&Q||R;module.exports=S.default||S;
|