Created
December 1, 2014 00:51
-
-
Save markreid/a293b37b5d4ec176d448 to your computer and use it in GitHub Desktop.
jasmine 1.3 async
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
var hasRun = false; | |
var job; | |
runs(function(){ | |
addJob(function(returnedJob){ | |
// this is some asynchronous thing | |
job = returnedJob; | |
hasRun = true; | |
}) | |
}) | |
waitFor(function(){ | |
return hasRun; | |
}) | |
runs(function(){ | |
expect(job.something).toEqual(true); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment