-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
102 lines (91 loc) · 3.15 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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import test from 'ava'
import fn from './'
const Promise = require('bluebird')
const ghauth = Promise.promisify(require('ghauth'))
const authOptions = {
configName: 'ghTaskStatus',
note: 'Get GitHub task status',
userAgent: 'ghTaskStatus',
scope: ['repo']
}
test.before(async t => {
await ghauth(authOptions).then((authData) => t.token = authData.token)
})
// test('Get results for Owner/Repo/issues/Number', t => {
// return fn(['RichardLitt/github-task-status/issues/3'], {}, t.token).then(result => {
// t.same(result, {
// 'done': 2,
// 'undone': 2,
// 'progressio': 'http://progressed.io/bar/50',
// 'progressioTitle': 'http://progressed.io/bar/50?title=2/4'
// })
// })
// })
// test('Get results for Owner/Repo#Number', t => {
// return fn(['RichardLitt/github-task-status#3'], {}, t.token).then(result => {
// t.same(result, {
// 'done': 2,
// 'undone': 2,
// 'progressio': 'http://progressed.io/bar/50',
// 'progressioTitle': 'http://progressed.io/bar/50?title=2/4'
// })
// })
// })
test('Get results for github.com/Owner/Repo/issues/Number', t => {
return fn(['github.com/RichardLitt/github-task-status/issues/3'], {}, t.token).then(result => {
t.same(result, {
'done': 2,
'undone': 2,
'progressio': 'http://progressed.io/bar/50',
'progressioTitle': 'http://progressed.io/bar/50?title=2/4'
})
})
})
// test('Get results for http://github.com/Owner/Repo/issues/Number', t => {
// return fn(['http://github.com/RichardLitt/github-task-status/issues/3']).then(result => {
// t.same(result, {
// 'done': 2,
// 'undone': 2,
// 'progressio': 'http://progressed.io/bar/50',
// 'progressioTitle': 'http://progressed.io/bar/50?title=2/4'
// })
// })
// })
// test('Get results for https://github.com/Owner/Repo/issues/Number', t => {
// return fn(['https://github.com/RichardLitt/github-task-status/issues/3']).then(result => {
// t.same(result, {
// 'done': 2,
// 'undone': 2,
// 'progressio': 'http://progressed.io/bar/50',
// 'progressioTitle': 'http://progressed.io/bar/50?title=2/4'
// })
// })
// })
// test('Get results for https://api.github.com/Owner/Repo/issues/Number', t => {
// return fn(['https://api.github.com/RichardLitt/github-task-status/issues/3']).then(result => {
// t.same(result, {
// 'done': 2,
// 'undone': 2,
// 'progressio': 'http://progressed.io/bar/50',
// 'progressioTitle': 'http://progressed.io/bar/50?title=2/4'
// })
// })
// })
// test('Get results for https://api.github.com/repos/Owner/Repo/issues/Number', t => {
// return fn(['https://api.github.com/repos/RichardLitt/github-task-status/issues/3']).then(result => {
// t.same(result, {
// 'done': 2,
// 'undone': 2,
// 'progressio': 'http://progressed.io/bar/50',
// 'progressioTitle': 'http://progressed.io/bar/50?title=2/4'
// })
// })
// })
// test(t => {
// return fn('RichardLitt', {
// since: '2016-00-16T15:21:08.104Z',
// repo: 'get-issue-commenters'
// }).then(result => {
// t.throws(error, 'Since flag is an invalid date.')
// })
// })