Plato on Github
Report Home
dojo/tests/functional/_base/loader/support/pageReady.js
Maintainability
73.53
Lines of code
31
Difficulty
14.71
Estimated Errors
0.17
Function weight
By Complexity
By SLOC
define([ 'intern/dojo/node!leadfoot/helpers/pollUntil' ], function (pollUntil) { return function pageReady(url, config, test) { if (typeof config === 'function') { test = config; config = null; } var query = config; if (typeof config === 'object') { query = ''; for (var key in config) { query += (query ? '&' : '') + key + '=' + encodeURIComponent(config[key]); } } if (query) { url += '?' + query; } return function () { return test( this.get('remote') .setExecuteAsyncTimeout(20000) .get(url) .then(pollUntil(function () { return window.ready || null; })) ); }; }; });