-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhosted-git-info-from-manifest.js
More file actions
21 lines (17 loc) · 927 Bytes
/
Copy pathhosted-git-info-from-manifest.js
File metadata and controls
21 lines (17 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const t = require('tap')
const hostedFromMani = require('../../../lib/utils/hosted-git-info-from-manifest.js')
const hostedGitInfo = require('hosted-git-info')
t.equal(hostedFromMani({}), null)
t.equal(hostedFromMani({ repository: { no: 'url' } }), null)
t.equal(hostedFromMani({ repository: 123 }), null)
t.equal(hostedFromMani({ repository: 'not hosted anywhere' }), null)
t.equal(hostedFromMani({ repository: { url: 'not hosted anywhere' } }), null)
t.match(hostedFromMani({
repository: 'git+https://github.com/isaacs/abbrev-js',
}), hostedGitInfo.fromUrl('git+https://github.com/isaacs/abbrev-js'))
t.match(hostedFromMani({
repository: { url: 'git+https://github.com/isaacs/abbrev-js' },
}), hostedGitInfo.fromUrl('https://github.com/isaacs/abbrev-js'))
t.match(hostedFromMani({
repository: { url: 'git+ssh://git@github.com/isaacs/abbrev-js' },
}), hostedGitInfo.fromUrl('ssh://git@github.com/isaacs/abbrev-js'))