Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"it works": function(err, dupe, host) {
assert.ifError(err);
assert.isObject(dupe);
assert.isObject(host);
},
"and we check its properties": function(err, dupe, host) {
"it works": function(err, doc, res) {
assert.ifError(err);
assert.isObject(doc);
assert.isObject(res);
},
"it has an JRD content type": typeCheck("application/json; charset=utf-8")
"it includes the activity": function(err, feed, post, list) {
assert.ifError(err);
assert.isObject(feed);
assert.isObject(post);
assert.include(feed, "items");
assert.isArray(feed.items);
assert.greater(feed.items.length, 0);
assert.isObject(_.find(feed.items, function(item) { return item.id === post.id; }));
}
}
'should return a "connect logger" factory' : function(clm) {
assert.isObject(clm);
},
"it works": function(err, cred1, cred2) {
assert.ifError(err);
assert.isObject(cred1);
assert.isObject(cred2);
},
"and one user follows the other": {
"they include the activity": function(err, inbox2, inbox3, act) {
assert.ifError(err);
assert.isObject(inbox2);
assert.isObject(inbox3);
assert.isObject(act);
assert.include(inbox2, "items");
assert.isArray(inbox2.items);
assert.greater(inbox2.items.length, 0);
assert.isObject(_.find(inbox2.items, function(item) { return item.id === act.id; }),
"Activity is not in first inbox");
assert.include(inbox3, "items");
assert.isArray(inbox3.items);
assert.greater(inbox3.items.length, 0);
assert.isObject(_.find(inbox3.items, function(item) { return item.id === act.id; }),
"Activity is not in second inbox");
}
}
"we expect the next item to be an Object": function (topic) {
assert.isObject(topic);
assert.isFunction(topic.fix);
assert.isFunction(topic.getDetails);
}
},
"it works": function(err, act) {
assert.ifError(err);
assert.isObject(act);
}
}
"activity likes and replies feeds have right host": function(err, feed, act) {
var item;
assert.ifError(err);
assert.isObject(feed);
assert.isArray(feed.items);
assert.greater(feed.items.length, 0);
item = _.find(feed.items, function(item) { return item.id === act.id; });
assert.isObject(item);
assert.isObject(item.object);
assert.isObject(item.object.likes);
assert.isString(item.object.likes.url);
assert.equal(serverOf(item.object.likes.url), "photo.localhost");
assert.isObject(item.object.replies);
assert.isString(item.object.replies.url);
assert.equal(serverOf(item.object.replies.url), "photo.localhost");
}
},
'it should return a request object': function(oa) {
var request= oa.delete("http://foo.com/blah", "token", "token_secret")
assert.isObject(request);
assert.equal(request.method, "DELETE");
request.end();
}
},