tao-test/app/taoTests/views/js/loader/taoTestsRunner.min.js

2 lines
35 KiB
JavaScript
Raw Normal View History

2022-08-29 20:14:13 +02:00
define("taoTests/runner/areaBroker",["lodash","ui/areaBroker"],function(_,areaBroker$1){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,areaBroker$1=areaBroker$1&&Object.prototype.hasOwnProperty.call(areaBroker$1,"default")?areaBroker$1["default"]:areaBroker$1;var areaBroker=_.partial(areaBroker$1,["content","toolbox","navigation","control","header","panel"]);return areaBroker}),define("taoTests/runner/dataHolder",[],function(){'use strict';var defaultObjects=["testContext","testMap"];return function(){var map=new Map;return defaultObjects.forEach(function(entry){map.set(entry,{})}),map}}),define("taoTests/runner/plugin",["lodash","core/plugin"],function(_,pluginFactory){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory;var plugin=_.partialRight(pluginFactory,{hostName:"testRunner"});return plugin}),define("taoTests/runner/probeOverseer",["lodash","moment","lib/uuid","lib/moment-timezone.min"],function(_,moment,uuid){'use strict';function probeOverseerFactory(runner){function collectEvent(probe){var eventNs=".probe-".concat(probe.name),probeHandler=function(){var now=moment(),data={id:uuid(12,16),type:probe.name,timestamp:now.format("x")/1e3,timezone:now.tz(timeZone).format("Z")};"function"==typeof probe.capture&&(data.context=probe.capture.apply(probe,[runner].concat(slice.call(arguments)))),overseer.push(data)};return probe.latency?collectLatencyEvent(probe):void _.forEach(probe.events,function(eventName){var listen=0<eventName.indexOf(".")?eventName:eventName+eventNs;runner.on(listen,_.partial(probeHandler,eventName))})}function collectLatencyEvent(probe){var eventNs=".probe-".concat(probe.name),startHandler=function(){var now=moment(),data={id:uuid(12,16),marker:"start",type:probe.name,timestamp:now.format("x")/1e3,timezone:now.tz(timeZone).format("Z")};"function"==typeof probe.capture&&(data.context=probe.capture.apply(probe,[runner].concat(slice.call(arguments)))),overseer.push(data)},stopHandler=function(){var last,now=moment(),data={type:probe.name,timestamp:now.format("x")/1e3,timezone:now.tz(timeZone).format("Z")},args=slice.call(arguments);last=_.findLast(immutableQueue,{type:probe.name,marker:"start"}),last&&!_.findLast(immutableQueue,{type:probe.name,marker:"end",id:last.id})&&(data.id=last.id,data.marker="end","function"==typeof probe.capture&&(data.context=probe.capture.apply(probe,[runner].concat(args))),overseer.push(data))};return probe.latency?void(_.forEach(probe.startEvents,function(eventName){var listen=0<eventName.indexOf(".")?eventName:eventName+eventNs;runner.on(listen,_.partial(startHandler,eventName))}),_.forEach(probe.stopEvents,function(eventName){var listen=0<eventName.indexOf(".")?eventName:eventName+eventNs;runner.on(listen,_.partial(stopHandler,eventName))})):collectEvent(probe)}var overseer,queueStorage,probes=[],queue=[],immutableQueue=[],writing=Promise.resolve(),started=!1,getStorage=function(){return queueStorage?Promise.resolve(queueStorage):runner.getTestStore().getStore("test-probe").then(function(newStorage){return queueStorage=newStorage,Promise.resolve(queueStorage)})},resetStorage=function(){queueStorage=null};if(!_.isPlainObject(runner)||!_.isFunction(runner.init)||!_.isFunction(runner.on))throw new TypeError("Please set a test runner");return overseer={add:function(probe){if(!_.isPlainObject(probe))throw new TypeError("A probe is a plain object");if(!_.isString(probe.name)||_.isEmpty(probe.name))throw new TypeError("A probe must have a name");if(0<_.where(probes,{name:probe.name}).length)throw new TypeError("A probe with this name is already regsitered");if(probe.latency){if(_.isString(probe.startEvents)&&!_.isEmpty(probe.startEvents)&&(probe.startEvents=[probe.startEvents]),_.isString(probe.stopEvents)&&!_.isEmpty(probe.stopEvents)&&(probe.stopEvents=[probe.stopEvents]),!probe.startEvents.length||!probe.stopEvents.length)throw new TypeError("Latency based probes must have startE
//# sourceMappingURL=taoTestsRunner.min.js.map