Skip to content

Instantly share code, notes, and snippets.

@lawnsea
Created December 5, 2014 04:09

Revisions

  1. lawnsea created this gist Dec 5, 2014.
    20 changes: 20 additions & 0 deletions pollUntil-timeout-bug.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    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.');
    });
    });
    });
    });