Created
August 8, 2014 19:03
Simple helper for async tests in Jasmine 1.3 that mimics 2.0 and Mocha
This file contains hidden or 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
/** | |
* Jasmine 1.3 async helper | |
*/ | |
function async (run) { | |
return function () { | |
var done = false | |
waitsFor(function () { return done }) | |
run(function () { done = true }) | |
} | |
} | |
// usage: | |
// it('should be async', async(function(done) { | |
// setTimeout(done, 1000) | |
// })) |
Thanks a ton.
I'm stuck on Jasmine 1.3 for debugging/VSCode/NodeJS reasons, so this was very useful! Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sweet, just what i was looking for. Thanks 👍