Skip to content

Instantly share code, notes, and snippets.

@lawnsea
Created December 5, 2014 04:09
Show Gist options
  • Save lawnsea/1da6ab02bd9b0a8f7b3b to your computer and use it in GitHub Desktop.
Save lawnsea/1da6ab02bd9b0a8f7b3b to your computer and use it in GitHub Desktop.
This is an Intern test suite that demonstrates a bug in Leadfoot's pollUntil helper
define([
'intern!tdd',
'intern/dojo/node!leadfoot/helpers/pollUntil',
],
function (tdd, pollUntil) {
tdd.suite('pollUntil', function () {
tdd.test('should call the errback if it times out', function () {
return this.get('remote')
.get('http://google.com')
.then(pollUntil(function () {
return null;
}, 1000))
.then(function (val) {
console.log('Super weird.', val);
}, function () {
console.log('As expected.');
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment