forked from khrome/xbox-live
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
44 lines (38 loc) · 1.24 KB
/
test.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
44
var should = require("should");
var request = require("request");
var XBoxLive = require('./xbox-live');
var gamertag = "khr0me"; // me, since they killed Major+Nelson's game history
var game = '4b5907dc'; //1264125916; //'Tropico 4'
describe('XBoxLive', function(){
var api;
describe('.GamerCard', function(){
before(function(){
api = new XBoxLive.Service.GamerCard();
});
it('fetches profile', function(done){
this.timeout(10000);
api.profile({
gamertag : gamertag
}, function(err, data){
should.not.exist(err);
should.exist(data);
should.exist(data.gamertag);
should.exist(data.gamerscore);
game = data.games[0].id;
done();
});
});
it('fetches games', function(done){
this.timeout(10000);
api.games({
id : game
}, function(err, data){
should.not.exist(err);
should.exist(data);
should.exist(data.title);
should.exist(data.icon);
done();
});
});
});
});