forked from octokit/octokit.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient_test.js
More file actions
62 lines (52 loc) · 1.78 KB
/
Copy pathclient_test.js
File metadata and controls
62 lines (52 loc) · 1.78 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* Copyright 2012 Cloud9 IDE, Inc.
*
* This product includes software developed by
* Cloud9 IDE, Inc (http://c9.io).
*
* Author: Mike de Boer <[email protected]>
*/
"use strict";
var Assert = require("assert");
var Client = require("./../index");
describe("[client]", function() {
var client;
var token = "e5a4a27487c26e571892846366de023349321a73";
beforeEach(function() {
client = new Client({
version: "3.0.0"
});
/*client.authenticate({
type: "oauth",
token: token
});*/
});
it("should successfully execute GET /authorizations (getAll)", function(next) {
// `aseemk` has two pages of followers right now.
client.user.getFollowers(
{
user: "aseemk"
},
function(err, res) {
Assert.equal(err, null);
Assert.ok(!!client.hasNextPage(res));
Assert.ok(!!client.hasLastPage(res));
Assert.ok(!client.hasPreviousPage(res));
client.getNextPage(res, function(err, res) {
Assert.equal(err, null);
Assert.ok(!!client.hasPreviousPage(res));
Assert.ok(!!client.hasFirstPage(res));
Assert.ok(!client.hasNextPage(res));
Assert.ok(!client.hasLastPage(res));
client.getPreviousPage(res.meta.link, function(err, res) {
Assert.equal(err, null);
Assert.ok(!!client.hasNextPage(res));
Assert.ok(!!client.hasLastPage(res));
Assert.ok(!client.hasPreviousPage(res));
next();
});
});
}
);
});
});