Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
mocha + firebase + event emitter
it("responds to 'new_user' event", function(done) {
var user = new Model.User({
'email': 'thisemail@something.com',
'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
You can’t perform that action at this time.