Created
August 6, 2012 13:49
-
-
Save andreabalducci/3274571 to your computer and use it in GitHub Desktop.
expectAsync extension for jasmine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var CALL_TIMEOUT = 4000; | |
function expectAsync(promise, expectations) { | |
var completed = false; | |
runs(function () { | |
promise.call().always(function () { | |
completed = true; | |
}) | |
}); | |
waitsFor(function () { | |
return completed; | |
}, CALL_TIMEOUT); | |
runs(function () { | |
expectations.call(); | |
}); | |
} |
Author
andreabalducci
commented
Aug 6, 2012
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment