Skip to content

Commit 7af589c

Browse files
committed
lint, fix repeated assertions
1 parent 537c1ce commit 7af589c

File tree

4 files changed

+24
-27
lines changed

4 files changed

+24
-27
lines changed

test/bitbucket.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const t = require('tap')
44

55
const invalid = [
66
// invalid protocol
7-
'git://bitbucket.org/foo/bar',
7+
'git://bitbucket.org/foo/bar'
88
]
99

1010
const defaults = { type: 'bitbucket', user: 'foo', project: 'bar' }
@@ -134,7 +134,7 @@ const valid = {
134134
'https://user:[email protected]/foo/bar.git': { ...defaults, default: 'https', auth: 'user:password' },
135135
'https://user:[email protected]/foo/bar.git#branch': { ...defaults, default: 'https', auth: 'user:password', committish: 'branch' },
136136
'https://:[email protected]/foo/bar.git': { ...defaults, default: 'https', auth: ':password' },
137-
'https://:[email protected]/foo/bar.git#branch': { ...defaults, default: 'https', auth: ':password', committish: 'branch' },
137+
'https://:[email protected]/foo/bar.git#branch': { ...defaults, default: 'https', auth: ':password', committish: 'branch' }
138138
}
139139

140140
t.test('valid urls parse properly', t => {

test/gist.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const invalid = [
1212
'ssh://gist.github.com:feedbeef',
1313
'ssh://gist.github.com:feedbeef#branch',
1414
'ssh://gist.github.com:feedbeef.git',
15-
'ssh://gist.github.com:feedbeef.git#branch',
15+
'ssh://gist.github.com:feedbeef.git#branch'
1616
]
1717

1818
// user defaults to an empty string for all inputs that do not specify one
@@ -303,7 +303,7 @@ const valid = {
303303
'https://user:[email protected]/foo/feedbeef.git': { ...defaults, default: 'https', auth: 'user:password', user: 'foo' },
304304
'https://user:[email protected]/foo/feedbeef.git#branch': { ...defaults, default: 'https', auth: 'user:password', user: 'foo', committish: 'branch' },
305305
'https://:[email protected]/foo/feedbeef.git': { ...defaults, default: 'https', auth: ':password', user: 'foo' },
306-
'https://:[email protected]/foo/feedbeef.git#branch': { ...defaults, default: 'https', auth: ':password', user: 'foo', committish: 'branch' },
306+
'https://:[email protected]/foo/feedbeef.git#branch': { ...defaults, default: 'https', auth: ':password', user: 'foo', committish: 'branch' }
307307
}
308308

309309
t.test('valid urls parse properly', t => {
@@ -353,7 +353,6 @@ t.test('string methods populate correctly', t => {
353353

354354
t.equal(parsed.ssh({ committish: 'fix/bug' }), '[email protected]:/feedbeef.git#fix/bug', 'allows overriding options')
355355

356-
357356
const extra = HostedGit.fromUrl('https://[email protected]/foo/feedbeef#fix/bug')
358357
t.equal(extra.hash(), '#fix/bug', 'hash() returns a hash plus the committish when set')
359358
t.equal(extra.https(), 'git+https://gist.github.com/feedbeef.git#fix/bug', 'https() includes auth when set')

test/github.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const invalid = [
1212
// invalid URI encoding
1313
'github:foo%0N/bar',
1414
// missing path
15-
'git+ssh://[email protected]:',
15+
'git+ssh://[email protected]:'
1616
]
1717

1818
const defaults = { type: 'github', user: 'foo', project: 'bar' }
@@ -101,10 +101,10 @@ const valid = {
101101
'git+ssh://github.com:foo/bar.git#branch': { ...defaults, default: 'sshurl', committish: 'branch' },
102102
'git+ssh://[email protected]:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
103103
'git+ssh://[email protected]:foo/bar.git#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
104-
'git+ssh://user:[email protected]:foo/bar': { ...defaults, default: 'sshurl', auth: null },
105-
'git+ssh://user:[email protected]:foo/bar#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
106-
'git+ssh://:[email protected]:foo/bar': { ...defaults, default: 'sshurl', auth: null },
107-
'git+ssh://:[email protected]:foo/bar#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
104+
'git+ssh://user:[email protected]:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
105+
'git+ssh://user:[email protected]:foo/bar.git#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
106+
'git+ssh://:[email protected]:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
107+
'git+ssh://:[email protected]:foo/bar.git#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
108108

109109
// ssh urls
110110
//
@@ -122,10 +122,10 @@ const valid = {
122122
'ssh://github.com:foo/bar.git#branch': { ...defaults, default: 'sshurl', committish: 'branch' },
123123
'ssh://[email protected]:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
124124
'ssh://[email protected]:foo/bar.git#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
125-
'ssh://user:[email protected]:foo/bar': { ...defaults, default: 'sshurl', auth: null },
126-
'ssh://user:[email protected]:foo/bar#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
127-
'ssh://:[email protected]:foo/bar': { ...defaults, default: 'sshurl', auth: null },
128-
'ssh://:[email protected]:foo/bar#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
125+
'ssh://user:[email protected]:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
126+
'ssh://user:[email protected]:foo/bar.git#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
127+
'ssh://:[email protected]:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
128+
'ssh://:[email protected]:foo/bar.git#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
129129

130130
// git+https urls
131131
//
@@ -167,7 +167,7 @@ const valid = {
167167
'https://user:[email protected]/foo/bar.git': { ...defaults, default: 'https', auth: 'user:password' },
168168
'https://user:[email protected]/foo/bar.git#branch': { ...defaults, default: 'https', auth: 'user:password', committish: 'branch' },
169169
'https://:[email protected]/foo/bar.git': { ...defaults, default: 'https', auth: ':password' },
170-
'https://:[email protected]/foo/bar.git#branch': { ...defaults, default: 'https', auth: ':password', committish: 'branch' },
170+
'https://:[email protected]/foo/bar.git#branch': { ...defaults, default: 'https', auth: ':password', committish: 'branch' }
171171
}
172172

173173
t.test('valid urls parse properly', t => {
@@ -221,7 +221,6 @@ t.test('string methods populate correctly', t => {
221221

222222
t.equal(parsed.docs({ committish: 'fix/bug' }), 'https://github.com/foo/bar/tree/fix%2Fbug#readme', 'allows overriding options')
223223

224-
225224
const extra = HostedGit.fromUrl('https://[email protected]/foo/bar#fix/bug')
226225
t.equal(extra.hash(), '#fix/bug', 'hash() returns a hash plus the committish when set')
227226
t.equal(extra.https(), 'git+https://[email protected]/foo/bar.git#fix/bug', 'https() includes auth when set')

test/gitlab.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const invalid = [
1616
'user:[email protected]:foo/bar/baz.git',
1717
'user:[email protected]:foo/bar/baz.git#branch',
1818
':[email protected]:foo/bar/baz.git',
19-
':[email protected]:foo/bar/baz.git#branch',
19+
':[email protected]:foo/bar/baz.git#branch'
2020
]
2121

2222
const defaults = { type: 'gitlab', user: 'foo', project: 'bar' }
@@ -95,10 +95,10 @@ const valid = {
9595
'git+ssh://gitlab.com:foo/bar.git#branch': { ...defaults, default: 'sshurl', committish: 'branch' },
9696
'git+ssh://[email protected]:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
9797
'git+ssh://[email protected]:foo/bar.git#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
98-
'git+ssh://user:[email protected]:foo/bar': { ...defaults, default: 'sshurl', auth: null },
99-
'git+ssh://user:[email protected]:foo/bar#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
100-
'git+ssh://:[email protected]:foo/bar': { ...defaults, default: 'sshurl', auth: null },
101-
'git+ssh://:[email protected]:foo/bar#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
98+
'git+ssh://user:[email protected]:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
99+
'git+ssh://user:[email protected]:foo/bar.git#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
100+
'git+ssh://:[email protected]:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
101+
'git+ssh://:[email protected]:foo/bar.git#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
102102

103103
'git+ssh://gitlab.com:foo/bar/baz': { ...defaults, default: 'sshurl' },
104104
'git+ssh://gitlab.com:foo/bar/baz#branch': { ...defaults, default: 'sshurl', committish: 'branch' },
@@ -135,10 +135,10 @@ const valid = {
135135
'ssh://gitlab.com:foo/bar.git#branch': { ...defaults, default: 'sshurl', committish: 'branch' },
136136
'ssh://[email protected]:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
137137
'ssh://[email protected]:foo/bar.git#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
138-
'ssh://user:[email protected]:foo/bar': { ...defaults, default: 'sshurl', auth: null },
139-
'ssh://user:[email protected]:foo/bar#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
140-
'ssh://:[email protected]:foo/bar': { ...defaults, default: 'sshurl', auth: null },
141-
'ssh://:[email protected]:foo/bar#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
138+
'ssh://user:[email protected]:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
139+
'ssh://user:[email protected]:foo/bar.git#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
140+
'ssh://:[email protected]:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
141+
'ssh://:[email protected]:foo/bar.git#branch': { ...defaults, default: 'sshurl', auth: null, committish: 'branch' },
142142

143143
'ssh://gitlab.com:foo/bar/baz': { ...defaults, default: 'sshurl' },
144144
'ssh://gitlab.com:foo/bar/baz#branch': { ...defaults, default: 'sshurl', committish: 'branch' },
@@ -236,7 +236,7 @@ const valid = {
236236
'https://user:[email protected]/foo/bar/baz.git': { ...defaults, default: 'https', auth: 'user:password' },
237237
'https://user:[email protected]/foo/bar/baz.git#branch': { ...defaults, default: 'https', auth: 'user:password', committish: 'branch' },
238238
'https://:[email protected]/foo/bar/baz.git': { ...defaults, default: 'https', auth: ':password' },
239-
'https://:[email protected]/foo/bar/baz.git#branch': { ...defaults, default: 'https', auth: ':password', committish: 'branch' },
239+
'https://:[email protected]/foo/bar/baz.git#branch': { ...defaults, default: 'https', auth: ':password', committish: 'branch' }
240240
}
241241

242242
t.test('valid urls parse properly', t => {
@@ -287,7 +287,6 @@ t.test('string methods populate correctly', t => {
287287

288288
t.equal(parsed.docs({ committish: 'fix/bug' }), 'https://gitlab.com/foo/bar/tree/fix%2Fbug#readme', 'allows overriding options')
289289

290-
291290
const extra = HostedGit.fromUrl('https://[email protected]/foo/bar#fix/bug')
292291
t.equal(extra.hash(), '#fix/bug', 'hash() returns a hash plus the committish when set')
293292
t.equal(extra.https(), 'git+https://[email protected]/foo/bar.git#fix/bug', 'https() includes auth when set')

0 commit comments

Comments
 (0)