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

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lib/commands/docs.js13
-rw-r--r--test/lib/utils/hosted-git-info-from-manifest.js21
2 files changed, 9 insertions, 25 deletions
diff --git a/test/lib/commands/docs.js b/test/lib/commands/docs.js
index a3b31bd70..b2a65786b 100644
--- a/test/lib/commands/docs.js
+++ b/test/lib/commands/docs.js
@@ -35,6 +35,13 @@ const pkgDirs = t.testdir({
repository: { url: 'https://github.com/foo/repoobj' },
}),
},
+ repourlobj: {
+ 'package.json': JSON.stringify({
+ name: 'repourlobj',
+ version: '1.2.3',
+ repository: { url: { works: false } },
+ }),
+ },
workspaces: {
'package.json': JSON.stringify({
name: 'workspaces-test',
@@ -81,14 +88,13 @@ const docs = new Docs(npm)
t.afterEach(() => opened = {})
t.test('open docs urls', t => {
- // XXX It is very odd that `where` is how pacote knows to look anywhere other
- // than the cwd. I would think npm.localPrefix would factor in somehow
- flatOptions.where = pkgDirs
+ npm.localPrefix = pkgDirs
const expect = {
nodocs: 'https://www.npmjs.com/package/nodocs',
docsurl: 'https://bugzilla.localhost/docsurl',
repourl: 'https://github.com/foo/repourl#readme',
repoobj: 'https://github.com/foo/repoobj#readme',
+ repourlobj: 'https://www.npmjs.com/package/repourlobj',
'.': 'https://example.com',
}
const keys = Object.keys(expect)
@@ -110,7 +116,6 @@ t.test('open default package if none specified', async t => {
})
t.test('workspaces', (t) => {
- flatOptions.where = undefined
npm.localPrefix = join(pkgDirs, 'workspaces')
t.test('all workspaces', async t => {
await docs.execWorkspaces([], [])
diff --git a/test/lib/utils/hosted-git-info-from-manifest.js b/test/lib/utils/hosted-git-info-from-manifest.js
deleted file mode 100644
index 516d3d586..000000000
--- a/test/lib/utils/hosted-git-info-from-manifest.js
+++ /dev/null
@@ -1,21 +0,0 @@
-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'))