forked from github-tools/github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.spec.js
More file actions
71 lines (57 loc) · 1.79 KB
/
user.spec.js
File metadata and controls
71 lines (57 loc) · 1.79 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
63
64
65
66
67
68
69
70
71
import Github from '../lib/GitHub';
import testUser from './fixtures/user.json';
import {assertSuccessful, assertArray} from './helpers/callbacks';
describe('User', function() {
let github;
let user;
before(function() {
github = new Github({
username: testUser.USERNAME,
password: testUser.PASSWORD,
auth: 'basic'
});
user = github.getUser();
});
it('should get user repos', function(done) {
user.listRepos(assertArray(done));
});
it('should get user repos with options', function(done) {
const filterOpts = {
type: 'owner',
sort: 'updated',
per_page: 90, // eslint-disable-line
page: 10
};
user.listRepos(filterOpts, assertArray(done));
});
it('should get user orgs', function(done) {
user.listOrgs(assertArray(done));
});
it('should get user gists', function(done) {
user.listGists(assertArray(done));
});
it('should get user notifications', function(done) {
user.listNotifications(assertArray(done));
});
it('should get user notifications with options', function(done) {
const filterOpts = {
all: true,
participating: true,
since: '2015-01-01T00:00:00Z',
before: '2015-02-01T00:00:00Z'
};
user.listNotifications(filterOpts, assertArray(done));
});
it('should get the user\'s profile', function(done) {
user.getProfile(assertSuccessful(done));
});
it('should show user\'s starred repos', function(done) {
user.listStarredRepos(assertArray(done));
});
it('should follow user', function(done) {
user.follow('ingalls', assertSuccessful(done));
});
it('should unfollow user', function(done) {
user.unfollow('ingalls', assertSuccessful(done));
});
});