Skip to content

Instantly share code, notes, and snippets.

@markreid
Created December 1, 2014 00:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markreid/a293b37b5d4ec176d448 to your computer and use it in GitHub Desktop.
Save markreid/a293b37b5d4ec176d448 to your computer and use it in GitHub Desktop.
jasmine 1.3 async
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