Created
March 30, 2015 01:32
-
-
Save gmarceau/b7274a4bb25c0a2555eb to your computer and use it in GitHub Desktop.
elementatry testing in node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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