Skip to content

Commit 888f9b4

Browse files
author
Michael Perrotte
committed
test: added default fixtures and github specific fixtures
1 parent 3d1ad71 commit 888f9b4

File tree

6 files changed

+807
-82
lines changed

6 files changed

+807
-82
lines changed

test/fixtures/github.js

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
'use strict'
2+
3+
module.exports = [
4+
// Github Shorturls
5+
{
6+
host: function (p) { return p.owner + '/' + p.project },
7+
label: 'github-short'
8+
},
9+
{
10+
host: function (p) { return p.owner + '/' + p.project + '#' + p.branch },
11+
label: 'github-short#branch',
12+
hasBranch: true
13+
},
14+
{
15+
host: function (p) { return p.owner + '/' + p.project + '#' + p.branch },
16+
label: 'github-short#branch',
17+
hasBranch: true
18+
},
19+
// Insecure Protocols
20+
{
21+
host: function (p) { return 'git://' + p.domain + '/' + p.owner + '/' + p.project },
22+
label: 'git'
23+
},
24+
{
25+
host: function (p) { return 'git://' + p.domain + '/' + p.owner + '/' + p.project + '.git' },
26+
label: 'git.git'
27+
},
28+
{
29+
host: function (p) { return 'git://' + p.domain + '/' + p.owner + '/' + p.project + '#' + p.branch },
30+
label: 'git#branch',
31+
hasBranch: true
32+
},
33+
{
34+
host: function (p) { return 'git://' + p.domain + '/' + p.owner + '/' + p.project + '.git#' + p.branch },
35+
label: 'git.git#branch',
36+
hasBranch: true
37+
}
38+
]

test/fixtures/gitlab-subgroups.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict'
2+
3+
module.exports = [
4+
{
5+
host: function (p) { return p.shortname + ':' + p.owner + '/' + p.group + '/' + p.project },
6+
label: 'shortname'
7+
},
8+
{
9+
host: function (p) { return p.shortname + ':' + p.owner + '/' + p.group + '/' + p.project },
10+
label: 'shortname.git'
11+
},
12+
{
13+
host: function (p) { return p.shortname + ':' + p.owner + '/' + p.group + '/' + p.project + '#' + p.branch },
14+
label: 'shortname#branch',
15+
hasBranch: true
16+
},
17+
{
18+
host: function (p) { return p.shortname + ':' + p.owner + '/' + p.group + '/' + p.project + '#' + p.branch },
19+
label: 'shortname.git#branch',
20+
hasBranch: true
21+
}
22+
]

test/fixtures/gitlab.js

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
'use strcit'
2+
3+
module.exports = [
4+
{
5+
host: function (p) { return 'https://' + p.domain + '/' + p.owner + '/' + p.project },
6+
label: 'https'
7+
},
8+
{
9+
host: function (p) { return 'https://' + p.domain + '/' + p.owner + '/' + p.project + '.git' },
10+
label: 'https.git'
11+
},
12+
{
13+
host: function (p) { return 'https://' + p.domain + '/' + p.owner + '/' + p.project + '#' + p.branch },
14+
label: 'https#branch',
15+
hasBranch: true
16+
},
17+
{
18+
host: function (p) { return 'https://' + p.domain + '/' + p.owner + '/' + p.project + '.git#' + p.branch },
19+
label: 'https.git#branch',
20+
hasBranch: true
21+
},
22+
{
23+
host: function (p) { return 'https://' + p.domain + '/' + p.owner + '/' + p.project + '/-/' + 'archive' + '/3.3.2' + '/ws-3.3.2.tar.gz' },
24+
label: 'https.tar',
25+
isUndefined: true
26+
},
27+
{
28+
host: function (p) { return 'git+https://' + p.domain + '/' + p.owner + '/' + p.project },
29+
label: 'git+https'
30+
},
31+
{
32+
host: function (p) { return 'git+https://' + p.domain + '/' + p.owner + '/' + p.project + '.git' },
33+
label: 'git+https.git'
34+
},
35+
{
36+
host: function (p) { return 'git+https://' + p.domain + '/' + p.owner + '/' + p.project + '#' + p.branch },
37+
label: 'git+https#branch',
38+
hasBranch: true
39+
},
40+
{
41+
host: function (p) { return 'git+https://' + p.domain + '/' + p.owner + '/' + p.project + '.git#' + p.branch },
42+
label: 'git+https.git#branch',
43+
hasBranch: true
44+
},
45+
{
46+
host: function (p) { return 'git@' + p.domain + ':' + p.owner + '/' + p.project },
47+
label: 'ssh'
48+
},
49+
{
50+
host: function (p) { return 'git@' + p.domain + ':' + p.owner + '/' + p.project + '.git' },
51+
label: 'ssh.git'
52+
},
53+
{
54+
host: function (p) { return 'git@' + p.domain + ':' + p.owner + '/' + p.project + '#' + p.branch },
55+
label: 'ssh#branch',
56+
hasBranch: true
57+
},
58+
{
59+
host: function (p) { return 'git@' + p.domain + ':' + p.owner + '/' + p.project + '.git#' + p.branch },
60+
label: 'ssh.git#branch',
61+
hasBranch: true
62+
},
63+
{
64+
host: function (p) { return 'git+ssh://git@' + p.domain + '/' + p.owner + '/' + p.project },
65+
label: 'ssh-url'
66+
},
67+
{
68+
host: function (p) { return 'git+ssh://git@' + p.domain + '/' + p.owner + '/' + p.project + '.git' },
69+
label: 'ssh-url.git'
70+
},
71+
{
72+
host: function (p) { return 'git+ssh://git@' + p.domain + '/' + p.owner + '/' + p.project + '#' + p.branch },
73+
label: 'ssh-url#branch',
74+
hasBranch: true
75+
},
76+
{
77+
host: function (p) { return 'git+ssh://git@' + p.domain + '/' + p.owner + '/' + p.project + '.git#' + p.branch },
78+
label: 'ssh-url.git#branch',
79+
hasBranch: true
80+
},
81+
{
82+
host: function (p) { return p.shortname + ':' + p.owner + '/' + p.project },
83+
label: 'shortcut'
84+
},
85+
{
86+
host: function (p) { return p.shortname + ':' + p.owner + '/' + p.project + '.git' },
87+
label: 'shortcut.git'
88+
},
89+
{
90+
host: function (p) { return p.shortname + ':' + p.owner + '/' + p.project + '#' + p.branch },
91+
label: 'shortcut#branch',
92+
hasBranch: true
93+
},
94+
{
95+
host: function (p) { return p.shortname + ':' + p.owner + '/' + p.project + '.git#' + p.branch },
96+
label: 'shortcut.git#branch',
97+
hasBranch: true
98+
}
99+
]

test/fixtures/index.js

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
'use strcit'
2+
3+
module.exports = [
4+
{
5+
host: function (p) { return 'https://' + p.domain + '/' + p.owner + '/' + p.project },
6+
label: 'https'
7+
},
8+
{
9+
host: function (p) { return 'https://' + p.domain + '/' + p.owner + '/' + p.project + '.git' },
10+
label: 'https.git'
11+
},
12+
{
13+
host: function (p) { return 'https://' + p.domain + '/' + p.owner + '/' + p.project + '#' + p.branch },
14+
label: 'https#branch',
15+
hasBranch: true
16+
},
17+
{
18+
host: function (p) { return 'https://' + p.domain + '/' + p.owner + '/' + p.project + '.git#' + p.branch },
19+
label: 'https.git#branch',
20+
hasBranch: true
21+
},
22+
{
23+
host: function (p) { return 'https://' + p.domain + '/' + p.owner + '/' + p.project + '/-/' + 'archive' + '/3.3.2' + '/ws-3.3.2.tar.gz' },
24+
label: 'https.tar',
25+
isUndefined: true
26+
},
27+
{
28+
host: function (p) { return 'git+https://' + p.domain + '/' + p.owner + '/' + p.project },
29+
label: 'git+https'
30+
},
31+
{
32+
host: function (p) { return 'git+https://' + p.domain + '/' + p.owner + '/' + p.project + '.git' },
33+
label: 'git+https.git'
34+
},
35+
{
36+
host: function (p) { return 'git+https://' + p.domain + '/' + p.owner + '/' + p.project + '#' + p.branch },
37+
label: 'git+https#branch',
38+
hasBranch: true
39+
},
40+
{
41+
host: function (p) { return 'git+https://' + p.domain + '/' + p.owner + '/' + p.project + '.git#' + p.branch },
42+
label: 'git+https.git#branch',
43+
hasBranch: true
44+
},
45+
{
46+
host: function (p) { return 'git@' + p.domain + ':' + p.owner + '/' + p.project },
47+
label: 'ssh'
48+
},
49+
{
50+
host: function (p) { return 'git@' + p.domain + ':' + p.owner + '/' + p.project + '.git' },
51+
label: 'ssh.git'
52+
},
53+
{
54+
host: function (p) { return 'git@' + p.domain + ':' + p.owner + '/' + p.project + '#' + p.branch },
55+
label: 'ssh#branch',
56+
hasBranch: true
57+
},
58+
{
59+
host: function (p) { return 'git@' + p.domain + ':' + p.owner + '/' + p.project + '.git#' + p.branch },
60+
label: 'ssh.git#branch',
61+
hasBranch: true
62+
},
63+
{
64+
host: function (p) { return 'git+ssh://git@' + p.domain + '/' + p.owner + '/' + p.project },
65+
label: 'ssh-url'
66+
},
67+
{
68+
host: function (p) { return 'git+ssh://git@' + p.domain + '/' + p.owner + '/' + p.project + '.git' },
69+
label: 'ssh-url.git'
70+
},
71+
{
72+
host: function (p) { return 'git+ssh://git@' + p.domain + '/' + p.owner + '/' + p.project + '#' + p.branch },
73+
label: 'ssh-url#branch',
74+
hasBranch: true
75+
},
76+
{
77+
host: function (p) { return 'git+ssh://git@' + p.domain + '/' + p.owner + '/' + p.project + '.git#' + p.branch },
78+
label: 'ssh-url.git#branch',
79+
hasBranch: true
80+
},
81+
{
82+
host: function (p) { return p.shortname + ':' + p.owner + '/' + p.project },
83+
label: 'shortcut'
84+
},
85+
{
86+
host: function (p) { return p.shortname + ':' + p.owner + '/' + p.project + '.git' },
87+
label: 'shortcut.git'
88+
},
89+
{
90+
host: function (p) { return p.shortname + ':' + p.owner + '/' + p.project + '#' + p.branch },
91+
label: 'shortcut#branch',
92+
hasBranch: true
93+
},
94+
{
95+
host: function (p) { return p.shortname + ':' + p.owner + '/' + p.project + '.git#' + p.branch },
96+
label: 'shortcut.git#branch',
97+
hasBranch: true
98+
}
99+
]

0 commit comments

Comments
 (0)