Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@servicenow/ui-testing-helpers

Package Overview
Dependencies
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@servicenow/ui-testing-helpers - npm Package Compare versions

Comparing version 17.0.3 to 18.0.0

lib/flush-queue.js

2

lib/create-driver-api.js

@@ -23,2 +23,2 @@ /**

*/
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=createDriverAPI;var e=_interopRequireDefault(require("lodash/isFunction"));var t=_interopRequireDefault(require("lodash/isEmpty"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(e){return typeof e}:function _typeof(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function asyncGeneratorStep(e,t,r,n,o,a,c){try{var i=e[a](c);var u=i.value}catch(e){return void r(e)}i.done?t(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function _next(e){asyncGeneratorStep(a,n,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(a,n,o,_next,_throw,"throw",e)}_next(void 0)}))}}function assertValidTag(e,t){return _assertValidTag.apply(this,arguments)}function _assertValidTag(){return _assertValidTag=_asyncToGenerator(regeneratorRuntime.mark((function _callee2(e,r){var n,o;return regeneratorRuntime.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:if(a.t0=!e||(0,t.default)(e),a.t0){a.next=6;break}return a.next=4,r.count();case 4:a.t1=a.sent,a.t0=0===a.t1;case 6:if(!a.t0){a.next=8;break}return a.abrupt("return");case 8:return e=Array.isArray(e)?e:[e],a.next=11,r.getTagName();case 11:if(n=a.sent.toUpperCase(),e.some((function(e){return e.toUpperCase()===n}))){a.next=15;break}throw o=e.map((function(e){return"<".concat(e.toLowerCase(),">")})),new Error("Cannot create driver with <".concat(n.toLowerCase(),"> node. Expected").concat(e.length>1?" one of":""," ").concat(o.join(", ")));case 15:case"end":return a.stop()}}),_callee2)}))),_assertValidTag.apply(this,arguments)}function resolveHoistedElement(e){if(e&&e.hasAttribute&&e.hasAttribute("hoist")){var t=e.getAttribute("component-id");var r=e.tagName.toLowerCase();var n="target-for='".concat(r,'[component-id="').concat(t,"\"]'");var o=document.querySelector("seismic-hoist[".concat(n,"]"));if(!o)throw new Error("Cannot find <seismic-hoist ".concat(n,"> node for hoisted <").concat(r,">"));return o}}function createDriverAPI(t,r){return function(){var n=_asyncToGenerator(regeneratorRuntime.mark((function _callee(n,o){var a,c,i,u;return regeneratorRuntime.wrap((function _callee$(s){for(;;)switch(s.prev=s.next){case 0:if((0,e.default)(o)){s.next=2;break}throw new Error("Cannot create component driver. Expected 2nd argument to be a strategy function but got ".concat(_typeof(o),"."));case 2:return a=resolveHoistedElement(n),c=a||n,s.next=6,o(c);case 6:if(i=s.sent,a){s.next=10;break}return s.next=10,assertValidTag(t,i);case 10:if((0,e.default)(r)){s.next=12;break}return s.abrupt("return",i);case 12:return s.next=14,Promise.resolve(r({node:c,element:o,driver:i,find:function find(e){return o(">>> ".concat(e),c)}}));case 14:return u=s.sent,s.abrupt("return",_objectSpread({},i,{},u));case 16:case"end":return s.stop()}}),_callee)})));return function(e,t){return n.apply(this,arguments)}}()}
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=createDriverAPI;var e=_interopRequireDefault(require("lodash/isFunction"));var t=_interopRequireDefault(require("lodash/isEmpty"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(e){return typeof e}:function _typeof(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function asyncGeneratorStep(e,t,r,n,o,a,c){try{var i=e[a](c);var u=i.value}catch(e){return void r(e)}i.done?t(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function _next(e){asyncGeneratorStep(a,n,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(a,n,o,_next,_throw,"throw",e)}_next(void 0)}))}}function assertValidTag(e,t){return _assertValidTag.apply(this,arguments)}function _assertValidTag(){return _assertValidTag=_asyncToGenerator(regeneratorRuntime.mark((function _callee2(e,r){var n,o;return regeneratorRuntime.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:if(a.t0=!e||(0,t.default)(e),a.t0){a.next=6;break}return a.next=4,r.count();case 4:a.t1=a.sent,a.t0=0===a.t1;case 6:if(!a.t0){a.next=8;break}return a.abrupt("return");case 8:return e=Array.isArray(e)?e:[e],a.next=11,r.getTagName();case 11:if(n=a.sent.toUpperCase(),e.some((function(e){return e.toUpperCase()===n}))){a.next=15;break}throw o=e.map((function(e){return"<".concat(e.toLowerCase(),">")})),new Error("Cannot create driver with <".concat(n.toLowerCase(),"> node. Expected").concat(e.length>1?" one of":""," ").concat(o.join(", ")));case 15:case"end":return a.stop()}}),_callee2)}))),_assertValidTag.apply(this,arguments)}function resolveHoistedElement(e){if(e&&e.hasAttribute&&(e.hasAttribute("hoist")||e.hasAttribute("now-hoist"))){var t=e.getAttribute("component-id");var r=e.tagName.toLowerCase();var n="target-for='".concat(r,'[component-id="').concat(t,"\"]'");var o=e.getProperty("nowHoistPrependTo")||e.getProperty("nowHoistAppendTo")||document;var a=o.querySelector("seismic-hoist[".concat(n,"]"));if(!a)throw new Error("Cannot find <seismic-hoist ".concat(n,"> node for hoisted <").concat(r,">"));return a}}function createDriverAPI(t,r){return function(){var n=_asyncToGenerator(regeneratorRuntime.mark((function _callee(n,o){var a,c,i,u;return regeneratorRuntime.wrap((function _callee$(s){for(;;)switch(s.prev=s.next){case 0:if((0,e.default)(o)){s.next=2;break}throw new Error("Cannot create component driver. Expected 2nd argument to be a strategy function but got ".concat(_typeof(o),"."));case 2:return a=resolveHoistedElement(n),c=a||n,s.next=6,o(c);case 6:if(i=s.sent,a){s.next=10;break}return s.next=10,assertValidTag(t,i);case 10:if((0,e.default)(r)){s.next=12;break}return s.abrupt("return",i);case 12:return s.next=14,Promise.resolve(r({node:c,element:o,driver:i,find:function find(e){return o(">>> ".concat(e),c)}}));case 14:return u=s.sent,s.abrupt("return",_objectSpread(_objectSpread({},i),u));case 16:case"end":return s.stop()}}),_callee)})));return function(e,t){return n.apply(this,arguments)}}()}

@@ -23,2 +23,2 @@ /**

*/
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=fixture;var e=_interopRequireDefault(require("lodash/isString"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function asyncGeneratorStep(e,r,t,n,a,o,u){try{var c=e[o](u);var i=c.value}catch(e){return void t(e)}c.done?r(i):Promise.resolve(i).then(n,a)}function _asyncToGenerator(e){return function(){var r=this,t=arguments;return new Promise((function(n,a){var o=e.apply(r,t);function _next(e){asyncGeneratorStep(o,n,a,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,a,_next,_throw,"throw",e)}_next(void 0)}))}}function fixture(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n=(0,e.default)(r);var a=t.onStateChange,o=t.onDisconnect;var u;var c=function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function _callee(){return regeneratorRuntime.wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:if(!u){e.next=2;break}throw new Error("Fixture was already created, call `destroy()` first");case 2:if(u=document.createElement("DIV"),document.body.appendChild(u),!n){e.next=8;break}u.innerHTML=r,e.next=10;break;case 8:return e.next=10,a(u,(function(){return r}),{},(function(){}));case 10:return e.abrupt("return",new Promise((function(e){setTimeout((function(){e(u.firstElementChild)}),16)})));case 11:case"end":return e.stop()}}),_callee)})));return function create(){return e.apply(this,arguments)}}();var i=function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function _callee2(){return regeneratorRuntime.wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:if(u){e.next=2;break}throw new Error("Fixture has not been created, call `create()` first");case 2:if(n){e.next=5;break}return e.next=5,o(u);case 5:return u.parentElement.removeChild(u),u=null,e.abrupt("return");case 8:case"end":return e.stop()}}),_callee2)})));return function destroy(){return e.apply(this,arguments)}}();return{create:c,destroy:i}}
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=fixture;var e=_interopRequireDefault(require("lodash/isString"));var r=_interopRequireDefault(require("./flush-queue"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function asyncGeneratorStep(e,r,t,n,a,u,o){try{var c=e[u](o);var i=c.value}catch(e){return void t(e)}c.done?r(i):Promise.resolve(i).then(n,a)}function _asyncToGenerator(e){return function(){var r=this,t=arguments;return new Promise((function(n,a){var u=e.apply(r,t);function _next(e){asyncGeneratorStep(u,n,a,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(u,n,a,_next,_throw,"throw",e)}_next(void 0)}))}}function fixture(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var a=(0,e.default)(t);var u=n.onStateChange,o=n.onDisconnect;var c;var i=function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function _callee(){return regeneratorRuntime.wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:if(!c){e.next=2;break}throw new Error("Fixture was already created, call `destroy()` first");case 2:if(c=document.createElement("DIV"),document.body.appendChild(c),!a){e.next=8;break}c.innerHTML=t,e.next=10;break;case 8:return e.next=10,u(c,(function(){return t}),{},(function(){}));case 10:return e.next=12,(0,r.default)();case 12:return e.abrupt("return",c.firstElementChild);case 13:case"end":return e.stop()}}),_callee)})));return function create(){return e.apply(this,arguments)}}();var s=function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function _callee2(){return regeneratorRuntime.wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:if(c){e.next=2;break}throw new Error("Fixture has not been created, call `create()` first");case 2:if(a){e.next=5;break}return e.next=5,o(c);case 5:return c.parentElement.removeChild(c),c=null,e.abrupt("return");case 8:case"end":return e.stop()}}),_callee2)})));return function destroy(){return e.apply(this,arguments)}}();return{create:i,destroy:s}}

@@ -23,2 +23,2 @@ /**

*/
Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"waitForRender",{enumerable:!0,get:function get(){return e.default}}),Object.defineProperty(exports,"willDispatch",{enumerable:!0,get:function get(){return r.default}}),Object.defineProperty(exports,"eventually",{enumerable:!0,get:function get(){return t.default}}),Object.defineProperty(exports,"fixture",{enumerable:!0,get:function get(){return u.default}}),Object.defineProperty(exports,"createDriverAPI",{enumerable:!0,get:function get(){return n.default}}),Object.defineProperty(exports,"findNode",{enumerable:!0,get:function get(){return i.default}});var e=_interopRequireDefault(require("./wait-for-render"));var r=_interopRequireDefault(require("./will-dispatch"));var t=_interopRequireDefault(require("./eventually"));var u=_interopRequireDefault(require("./fixture"));var n=_interopRequireDefault(require("./create-driver-api"));var i=_interopRequireDefault(require("./find-node"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}
Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"waitForRender",{enumerable:!0,get:function get(){return e.default}}),Object.defineProperty(exports,"willDispatch",{enumerable:!0,get:function get(){return r.default}}),Object.defineProperty(exports,"eventually",{enumerable:!0,get:function get(){return t.default}}),Object.defineProperty(exports,"fixture",{enumerable:!0,get:function get(){return u.default}}),Object.defineProperty(exports,"createDriverAPI",{enumerable:!0,get:function get(){return n.default}}),Object.defineProperty(exports,"findNode",{enumerable:!0,get:function get(){return i.default}}),Object.defineProperty(exports,"flushQueue",{enumerable:!0,get:function get(){return a.default}});var e=_interopRequireDefault(require("./wait-for-render"));var r=_interopRequireDefault(require("./will-dispatch"));var t=_interopRequireDefault(require("./eventually"));var u=_interopRequireDefault(require("./fixture"));var n=_interopRequireDefault(require("./create-driver-api"));var i=_interopRequireDefault(require("./find-node"));var a=_interopRequireDefault(require("./flush-queue"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}

@@ -23,2 +23,2 @@ /**

*/
function willDispatch(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:500;return new Promise((function(i,r){var o=setTimeout((function(){r(new Error("".concat(t," was not dispatched within ").concat(a,"ms")))}),a);var l=function listener(n){var a=n.detail,r=a.type,l=a.payload,s=a.meta;r===t&&(clearTimeout(o),i({type:r,payload:l,meta:s}),e.removeEventListener("DISPATCH_CUSTOM_EVENT",listener))};e.addEventListener("DISPATCH_CUSTOM_EVENT",l,!1),n()}))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=willDispatch;
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=willDispatch;var e=_interopRequireDefault(require("./flush-queue"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function asyncGeneratorStep(e,t,r,n,a,o,i){try{var u=e[o](i);var c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,a)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function _next(e){asyncGeneratorStep(o,n,a,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,a,_next,_throw,"throw",e)}_next(void 0)}))}}function willDispatch(e,t,r){return _willDispatch.apply(this,arguments)}function _willDispatch(){return _willDispatch=_asyncToGenerator(regeneratorRuntime.mark((function _callee2(t,r,n){var a,o,i=arguments;return regeneratorRuntime.wrap((function _callee2$(u){for(;;)switch(u.prev=u.next){case 0:return a=i.length>3&&void 0!==i[3]?i[3]:500,o=new Promise((function(e,n){var o=setTimeout((function(){t.removeEventListener("DISPATCH_CUSTOM_EVENT",i),n(new Error("".concat(r," was not dispatched within ").concat(a,"ms")))}),a);var i=function(){var n=_asyncToGenerator(regeneratorRuntime.mark((function _callee(n){var a,u,c,l;return regeneratorRuntime.wrap((function _callee$(s){for(;;)switch(s.prev=s.next){case 0:a=n.detail,u=a.type,c=a.payload,l=a.meta,u===r&&(clearTimeout(o),t.removeEventListener("DISPATCH_CUSTOM_EVENT",i),e({type:u,payload:c,meta:l}));case 2:case"end":return s.stop()}}),_callee)})));return function listener(e){return n.apply(this,arguments)}}();t.addEventListener("DISPATCH_CUSTOM_EVENT",i,!1)})),u.next=4,n();case 4:return u.next=6,(0,e.default)();case 6:return u.abrupt("return",o);case 7:case"end":return u.stop()}}),_callee2)}))),_willDispatch.apply(this,arguments)}
{
"name": "@servicenow/ui-testing-helpers",
"version": "17.0.3",
"version": "18.0.0",
"description": "",

@@ -23,5 +23,5 @@ "main": "lib/index.js",

"dependencies": {
"lodash": "4.17.11"
"lodash": "4.17.14"
},
"gitHead": "1b69e2d48f5d91ace245cf2eac7166622ff18b43"
"gitHead": "f2266d05cbad2e455542e09db60de0b69dfc6745"
}

@@ -23,2 +23,2 @@ /**

*/
import t from"lodash/isFunction";import e from"lodash/isEmpty";async function assertValidTag(t,o){if(!t||e(t)||0===await o.count())return;t=Array.isArray(t)?t:[t];const r=(await o.getTagName()).toUpperCase();if(!t.some(t=>t.toUpperCase()===r)){const e=t.map(t=>`<${t.toLowerCase()}>`);throw new Error(`Cannot create driver with <${r.toLowerCase()}> node. Expected${t.length>1?" one of":""} ${e.join(", ")}`)}}function resolveHoistedElement(t){if(t&&t.hasAttribute&&t.hasAttribute("hoist")){const e=t.getAttribute("component-id");const o=t.tagName.toLowerCase();const r=`target-for='${o}[component-id="${e}"]'`;const n=document.querySelector(`seismic-hoist[${r}]`);if(!n)throw new Error(`Cannot find <seismic-hoist ${r}> node for hoisted <${o}>`);return n}}export default function createDriverAPI(e,o){return async function(r,n){if(!t(n))throw new Error(`Cannot create component driver. Expected 2nd argument to be a strategy function but got ${typeof n}.`);const i=resolveHoistedElement(r);const a=i||r;const s=await n(a);if(i||await assertValidTag(e,s),!t(o))return s;const c=await Promise.resolve(o({node:a,element:n,driver:s,find:t=>n(`>>> ${t}`,a)}));return{...s,...c}}}
import t from"lodash/isFunction";import e from"lodash/isEmpty";async function assertValidTag(t,o){if(!t||e(t)||0===await o.count())return;t=Array.isArray(t)?t:[t];const r=(await o.getTagName()).toUpperCase();if(!t.some(t=>t.toUpperCase()===r)){const e=t.map(t=>`<${t.toLowerCase()}>`);throw new Error(`Cannot create driver with <${r.toLowerCase()}> node. Expected${t.length>1?" one of":""} ${e.join(", ")}`)}}function resolveHoistedElement(t){if(t&&t.hasAttribute&&(t.hasAttribute("hoist")||t.hasAttribute("now-hoist"))){const e=t.getAttribute("component-id");const o=t.tagName.toLowerCase();const r=`target-for='${o}[component-id="${e}"]'`;const n=t.getProperty("nowHoistPrependTo")||t.getProperty("nowHoistAppendTo")||document;const i=n.querySelector(`seismic-hoist[${r}]`);if(!i)throw new Error(`Cannot find <seismic-hoist ${r}> node for hoisted <${o}>`);return i}}export default function createDriverAPI(e,o){return async function(r,n){if(!t(n))throw new Error(`Cannot create component driver. Expected 2nd argument to be a strategy function but got ${typeof n}.`);const i=resolveHoistedElement(r);const s=i||r;const a=await n(s);if(i||await assertValidTag(e,a),!t(o))return a;const c=await Promise.resolve(o({node:s,element:n,driver:a,find:t=>n(`>>> ${t}`,s)}));return{...a,...c}}}

@@ -23,2 +23,2 @@ /**

*/
import e from"lodash/isString";export default function fixture(t,r={}){const n=e(t);const{onStateChange:o,onDisconnect:a}=r;let i;const create=async()=>{if(i)throw new Error("Fixture was already created, call `destroy()` first");return i=document.createElement("DIV"),document.body.appendChild(i),n?i.innerHTML=t:await o(i,()=>t,{},()=>{}),new Promise(e=>{setTimeout(()=>{e(i.firstElementChild)},16)})};const destroy=async()=>{if(!i)throw new Error("Fixture has not been created, call `create()` first");n||await a(i),i.parentElement.removeChild(i),i=null};return{create:create,destroy:destroy}}
import e from"lodash/isString";import t from"./flush-queue";export default function fixture(r,n={}){const a=e(r);const{onStateChange:o,onDisconnect:i}=n;let c;const create=async()=>{if(c)throw new Error("Fixture was already created, call `destroy()` first");return c=document.createElement("DIV"),document.body.appendChild(c),a?c.innerHTML=r:await o(c,()=>r,{},()=>{}),await t(),c.firstElementChild};const destroy=async()=>{if(!c)throw new Error("Fixture has not been created, call `create()` first");a||await i(c),c.parentElement.removeChild(c),c=null};return{create:create,destroy:destroy}}

@@ -23,2 +23,2 @@ /**

*/
export{default as waitForRender}from"./wait-for-render";export{default as willDispatch}from"./will-dispatch";export{default as eventually}from"./eventually";export{default as fixture}from"./fixture";export{default as createDriverAPI}from"./create-driver-api";export{default as findNode}from"./find-node";
export{default as waitForRender}from"./wait-for-render";export{default as willDispatch}from"./will-dispatch";export{default as eventually}from"./eventually";export{default as fixture}from"./fixture";export{default as createDriverAPI}from"./create-driver-api";export{default as findNode}from"./find-node";export{default as flushQueue}from"./flush-queue";

@@ -23,2 +23,2 @@ /**

*/
export default function willDispatch(e,t,a,n=500){return new Promise((i,o)=>{const r=setTimeout(()=>{o(new Error(`${t} was not dispatched within ${n}ms`))},n);const listener=({detail:{type:a,payload:n,meta:o}})=>{a===t&&(clearTimeout(r),i({type:a,payload:n,meta:o}),e.removeEventListener("DISPATCH_CUSTOM_EVENT",listener))};e.addEventListener("DISPATCH_CUSTOM_EVENT",listener,!1),a()})}
import e from"./flush-queue";export default async function willDispatch(t,a,n,i=500){const o=new Promise((e,n)=>{const o=setTimeout(()=>{t.removeEventListener("DISPATCH_CUSTOM_EVENT",listener),n(new Error(`${a} was not dispatched within ${i}ms`))},i);const listener=async({detail:{type:n,payload:i,meta:r}})=>{n===a&&(clearTimeout(o),t.removeEventListener("DISPATCH_CUSTOM_EVENT",listener),e({type:n,payload:i,meta:r}))};t.addEventListener("DISPATCH_CUSTOM_EVENT",listener,!1)});return await n(),await e(),o}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc