<commit_before>var should = require('should')
var twitter = require('../data/twitter');

describe('twitter', function(){
  describe('#getCachedTweetsFromDate', function(){
    it('should get tweets from today', function(done){
      var today = new Date();
      twitter.getCachedTweetsFromDate('twitter', Date.now(), 1)
        .then(function(tweets){
          var statuses = tweets;
          statuses.length.should.be.above(0);
          for(var t in statuses){
            var tweetDate = new Date(statuses[t].created_at);
            tweetDate.getDate().should.equal(today.getDate());
            tweetDate.getMonth().should.equal(today.getMonth());
            tweetDate.getFullYear().should.equal(today.getFullYear());
          }
        }).then(done).fail(done);
    });
    //test for caching
  });
});
<commit_msg>test for retrieving older tweets<commit_after>var should = require('should')
var twitter = require('../data/twitter');

describe('twitter', function(){
  describe('#getCachedTweetsFromDate', function(){

    it('should get tweets from today', function(done){
      var today = new Date();
      twitter.getCachedTweetsFromDate('twitter', Date.now(), 1)
        .then(function(tweets){
          var statuses = tweets;
          statuses.length.should.be.above(0);
          for(var t in statuses){
            var tweetDate = new Date(statuses[t].created_at);
            tweetDate.getDate().should.equal(today.getDate());
            tweetDate.getMonth().should.equal(today.getMonth());
            tweetDate.getFullYear().should.equal(today.getFullYear());
          }
        }).then(done).fail(done);
    });

    it('should get tweets from five days ago', function(done){
      var day = new Date(Date.now() - 5*24*60*60*1000);
      twitter.getCachedTweetsFromDate('twitter', day.getTime(), 1)
        .then(function(tweets){
          var statuses = tweets;
          statuses.length.should.be.above(0);
          for(var t in statuses){
            var tweetDate = new Date(statuses[t].created_at);
            tweetDate.getDate().should.equal(day.getDate());
            tweetDate.getMonth().should.equal(day.getMonth());
            tweetDate.getFullYear().should.equal(day.getFullYear());
          }
        }).then(done).fail(done);
    });
    //test for caching
  });
});

{'fraction_non_alphanumeric': 0.1569390402075227, 'fraction_numerical': 0.007349762213575443, 'mean_word_length': 2.732258064516129, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3359194', 'n_tokens_mistral': 715, 'n_tokens_neox': 678, 'n_words': 123}