gitevents / core

GitEvents core; manage your user group with GitHub
MIT License
41 stars 19 forks source link

[WIP] add events integration test #156

Closed mike182uk closed 8 years ago

mike182uk commented 8 years ago

This PR adds high level integration tests for the events module (lib/events.js).

This is an alternative approach to https://github.com/gitevents/core/pull/152

PatrickHeneise commented 8 years ago

Very nice!

PatrickHeneise commented 8 years ago

I'll get rid of debug() at some point and replace with a logger, but one thing: why did you move the log after the error? It's good to see the log for a method call and then the error, otherwise you'll see an error and don't know where it's from?

mike182uk commented 8 years ago

@PatrickHeneise I moved the debug after the error because if an error occured, the vars you are referencing will not exist:

debug('GitHub:getFrom():' + sender.login); // because there was an error, sender is undefined

if (error) {
    return reject(new Error(error));
}
PatrickHeneise commented 8 years ago

right! makes sense