katoikia-app/web-ui/web-react/node_modules/preact/test-utils/dist/testUtils.umd.js

3 lines
1.1 KiB
JavaScript

!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("preact")):"function"==typeof define&&define.amd?define(["exports","preact"],t):t(n.preactTestUtils={},n.preact)}(this,function(n,t){function e(){return t.options.t=t.options.debounceRendering,t.options.debounceRendering=function(n){return t.options.o=n},function(){return t.options.o&&t.options.o()}}var r=function(n){return null!=n&&"function"==typeof n.then},o=0;function i(){t.options.o&&(t.options.o(),delete t.options.o),void 0!==t.options.t?(t.options.debounceRendering=t.options.t,delete t.options.t):t.options.debounceRendering=void 0}n.setupRerender=e,n.act=function(n){if(++o>1){var f=n();return r(f)?f.then(function(){--o}):(--o,Promise.resolve())}var u,c,d=t.options.requestAnimationFrame,a=e();t.options.requestAnimationFrame=function(n){return u=n};var l,p,y=function(){try{for(a();u;)c=u,u=null,c(),a()}catch(n){l||(l=n)}finally{i()}t.options.requestAnimationFrame=d,--o};try{p=n()}catch(n){l=n}if(r(p))return p.then(y,function(n){throw y(),n});if(y(),l)throw l;return Promise.resolve()},n.teardown=i});
//# sourceMappingURL=testUtils.umd.js.map