react-test-renderer 16.6.2 → 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.development.js +36 -43
- package/cjs/react-test-renderer.production.min.js +120 -121
- package/package.json +6 -6
- package/umd/react-test-renderer-shallow.development.js +785 -0
- package/umd/react-test-renderer-shallow.production.min.js +22 -0
- package/umd/react-test-renderer.development.js +12107 -0
- package/umd/react-test-renderer.production.min.js +121 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** @license React v16.6.1
|
|
2
|
+
* react-test-renderer-shallow.production.min.js
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
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: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});
|