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:
authorRebecca Turner <me@re-becca.org>2017-11-17 04:30:37 +0300
committerRebecca Turner <me@re-becca.org>2017-11-17 04:45:21 +0300
commit391ebcc9f266f32dee7ab0d90b56f141bd0a9634 (patch)
tree168bab474a38ba0c459b427d269a43f729832d26 /test
parentc3e1ec71eea4c9827f3598f0934540205fcdcfde (diff)
test: add-remote-git for new cache.add internals
Diffstat (limited to 'test')
-rw-r--r--test/tap/add-remote-git-file.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/tap/add-remote-git-file.js b/test/tap/add-remote-git-file.js
index 546a73ff6..20392af87 100644
--- a/test/tap/add-remote-git-file.js
+++ b/test/tap/add-remote-git-file.js
@@ -10,6 +10,7 @@ var rimraf = require('rimraf')
var test = require('tap').test
var npm = require('../../lib/npm.js')
+var fetchPackageMetadata = require('../../lib/fetch-package-metadata.js')
var common = require('../common-tap.js')
var pkg = resolve(__dirname, 'add-remote-git-file')
@@ -34,13 +35,15 @@ test('setup', function (t) {
test('cache from repo', function (t) {
process.chdir(pkg)
- return npm.commands.cache.add(cloneURL).then((data) => {
+ fetchPackageMetadata(cloneURL, process.cwd(), {}, (err, manifest) => {
+ if (err) t.fail(err.message)
t.equal(
- url.parse(data.manifest._resolved).protocol,
+ url.parse(manifest._resolved).protocol,
'git+file:',
'npm didn\'t go crazy adding git+git+git+git'
)
- t.equal(data.manifest._spec.type, 'git', 'cached git')
+ t.equal(manifest._requested.type, 'git', 'cached git')
+ t.end()
})
})