Reputation: 431
The intern 2 documentation gives the following example of waiting for a condition to be true on a test page after loading it:
this.remote
.get(require.toUrl('./SomeTest.html'))
.then(pollUntil('return window.ready;', 5000));
Unfortunately, it doesn't explain how to load the pollUntil helper in order to use it in the previous example... Does anybody have a complete working example that uses pollUntil ?
Thanks for your help.
Upvotes: 6
Views: 681
Reputation: 12696
intern 4 uses
define([
'dojo/request',
'dojo/node!@theintern/leadfoot/helpers/pollUntil'
],
function(request, _pollUntil) {
var pollUntil = _pollUntil.default;
var registerSuite = intern.getInterface('object').registerSuite;
var assert = intern.getPlugin('chai').assert;
});
Upvotes: 1
Reputation: 431
I think I found the answers: it works by loading module intern/dojo/node!leadfoot/helpers/pollUntil
, as in:
define([
'intern!object',
'intern/chai!assert',
'intern/dojo/node!leadfoot/helpers/pollUntil',
'../Request',
'require'
], function (registerSuite, assert, pollUntil, Request, require) {
Upvotes: 6