Skip to content

Instantly share code, notes, and snippets.

@gmarceau
Created March 30, 2015 01:32
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 gmarceau/b7274a4bb25c0a2555eb to your computer and use it in GitHub Desktop.
Save gmarceau/b7274a4bb25c0a2555eb to your computer and use it in GitHub Desktop.
elementatry testing in node
var should = require('should.js');
var p = require('./parsing.js')
var test Tweet =
{
"source" : "web",
"entities" : {
"user_mentions" : [ {
"name" : "Joanne Michele",
"screen_name" : "sabzbrach",
"indices" : [ 0, 10 ],
"id_str" : "15617140",
"id" : 15617140
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"in_reply_to_status_id_str" : "153253644551196672",
"geo" : {
},
"id_str" : "153254247629209600",
"in_reply_to_user_id" : 15617140,
"text" : "@SabzBrach oh, i know you wouldn't! (: no doubt. i do think that presidential politics are something that change anything that touches them.",
"id" : 153254247629209600,
"in_reply_to_status_id" : 153253644551196672,
"created_at" : "Sat Dec 31 23:20:34 +0000 2011",
"in_reply_to_screen_name" : "sabzbrach",
"in_reply_to_user_id_str" : "15617140",
"user" : {
"name" : "Dicey",
"screen_name" : "DiceyTroop",
"protected" : false,
"id_str" : "389880004",
"profile_image_url_https" : "https://si0.twimg.com/profile_images/2377202824/xvr9sra0ybahdez7xin9_normal.jpeg",
"id" : 389880004,
"verified" : false
}
};
p.parseDiskTweet(testTweet, "dicey").create_on.should.eql(new Date("Sat Dec 31 23:20:34 +0000 2011"));
p.parseDistTweet(testTweet, "diceytroop").donors.should.eql(["diceytroop"]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment