Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, reject) => {
const debouncedQuery = debounce(runQuery, 10, { leading: false, trailing: true })
let lastError, observer, timer, lastResult
lastResult = {}
function runQuery () {
if (typeof queryFn !== 'function') {
lastResult = {
results: [],
selector: JSON.stringify(queryFn)
}
onDone(new Error([
'[ui-test-utils] Invalid element query function.',
lastResult.selector
].join('\n')), lastResult)
return