Skip to content

Instantly share code, notes, and snippets.

@hammett
Created April 19, 2014 19:41
Show Gist options
  • Save hammett/11095200 to your computer and use it in GitHub Desktop.
Save hammett/11095200 to your computer and use it in GitHub Desktop.
mocha + firebase + event emitter
it("responds to 'new_user' event", function(done) {
var user = new Model.User({
'email': '[email protected]',
'name': 'testing'
});
_root.child('/users/').once('child_added', function(data) {
expect(data.name()).to.be(user._id.toString());
var userData = data.val();
expect(userData.name).to.be(user.name);
done();
});
emitter.emit('new_user', user);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment