Welcome to mirror list, hosted at ThFree Co, Russian Federation.

hosted-git-info-from-manifest.js « utils « lib « test - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 516d3d5867acbd0c8e0a2b6f9436ab7ff35024d9 (plain)
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'))