Skip to content

Instantly share code, notes, and snippets.

@jookyboi
Created October 4, 2013 19:03
Show Gist options
  • Save jookyboi/6830993 to your computer and use it in GitHub Desktop.
Save jookyboi/6830993 to your computer and use it in GitHub Desktop.
Testing async code using Mocha. From http://visionmedia.github.io/mocha/#asynchronous-code
describe('User', function(){
describe('#save()', function(){
it('should save without error', function(done){
var user = new User('Luna');
user.save(function(err){
if (err) throw err;
done();
});
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment