Testing events with Node.js