forked from octokit/octokit.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlabels-test.js
72 lines (58 loc) · 1.56 KB
/
labels-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
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
72
const {getInstance} = require('../util')
require('../mocha-node-setup')
describe('api.github.com', () => {
let github
beforeEach(() => {
return getInstance('labels')
.then(instance => {
github = instance
github.authenticate({
type: 'token',
token: '0000000000000000000000000000000000000001'
})
})
})
it('github.issues.*', () => {
return github.issues.getLabels({
owner: 'octokit-fixture-org',
repo: 'labels'
})
.then((result) => {
expect(result.data).to.be.an('array')
return github.issues.createLabel({
owner: 'octokit-fixture-org',
repo: 'labels',
name: 'test-label',
color: '663399'
})
})
.then((result) => {
expect(result.data.name).to.equal('test-label')
return github.issues.getLabel({
owner: 'octokit-fixture-org',
repo: 'labels',
name: 'test-label'
})
})
.then(() => {
return github.issues.updateLabel({
owner: 'octokit-fixture-org',
repo: 'labels',
oldname: 'test-label',
name: 'test-label-updated',
color: 'BADA55'
})
})
.then((result) => {
expect(result.data.name).to.equal('test-label-updated')
return github.issues.deleteLabel({
owner: 'octokit-fixture-org',
repo: 'labels',
name: 'test-label-updated'
})
})
.then((result) => {
expect(result.data).to.equal(undefined)
})
})
})