Skip to content

Instantly share code, notes, and snippets.

@Swizec
Created June 25, 2011 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Swizec/1046888 to your computer and use it in GitHub Desktop.
Save Swizec/1046888 to your computer and use it in GitHub Desktop.
my test:
'new track event': function (done) {
dispatcher.on('track new', function (url) {
// this fails with a mismatch
assert.equal(url, 'http://jc.is/lXFpfE');
done();
});
counter.track(3, 'http://jc.is/lXFpfE', function () {
});
},
the function:
track: function (id, url, callback) {
callback = callback || function () {};
/// some stuff is done
dispatcher.emit('track new', url);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment