Skip to content

Instantly share code, notes, and snippets.

@aoberoi
Created March 20, 2014 15:27
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 aoberoi/9666352 to your computer and use it in GitHub Desktop.
Save aoberoi/9666352 to your computer and use it in GitHub Desktop.
i've got it!
it('complains when the p2p or location values are not valid', function(done) {
var self = this;
// YAY higher order programming :)
var expectError = function(cb) {
return function(err, result) {
expect(err).to.be.an.instanceof(Error);
cb(null)
};
};
async.parallel([
function(cb) {
self.opentok.createSession({ p2p: 'lalalal' }, expectError(cb))
},
function(cb) {
self.opentok.createSession({ location: 'not an ip address' }, expectError(cb))
}
], done);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment