forked from AvianFlu/ntwitter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrend.js
43 lines (38 loc) · 1.18 KB
/
trend.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
var ntwitter = require('../index.js'),
mocha = require('mocha'),
should = require('should'),
fs = require('fs'),
config = JSON.parse(fs.readFileSync('./config.json'));
var twitter = new ntwitter({
consumer_key: config.key,
consumer_secret: config.secret,
access_token_key: config.token_key,
access_token_secret: config.token_secret
});
describe('Twitter Trend API', function() {
it('Origin getTrends still work', function(done) {
twitter.getTrends(function(err, data) {
data[0].trends.should.not.be.empty;
done();
});
});
it('Origin getCurrentTrends still work', function(done) {
twitter.getCurrentTrends(function(err, data) {
data[0].trends.should.not.be.empty;
done();
});
});
it('GET trends/:woeid data without earth id', function(done) {
twitter.getTrendsWithId(null, function(err, data) {
data[0].trends.should.not.be.empty;
done();
});
});
it('GET trends/:woeid data wih earth id', function(done) {
twitter.getTrendsWithId('23424977', function(err, data) {
data[0].trends.should.not.be.empty;
data[0].locations[0].name.should.equal('United States');
done();
});
});
});