summaryrefslogtreecommitdiff
path: root/deps/npm/test
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/test')
-rw-r--r--deps/npm/test/tap/dedupe.js3
-rw-r--r--deps/npm/test/tap/dedupe/package.json4
-rw-r--r--deps/npm/test/tap/git-cache-locking.js43
-rw-r--r--deps/npm/test/tap/install-at-locally.js43
-rw-r--r--deps/npm/test/tap/install-at-locally/package@1.2.3/package.json5
-rw-r--r--deps/npm/test/tap/npm-api-not-loaded-error.js47
-rw-r--r--deps/npm/test/tap/outdated-color.js41
-rw-r--r--deps/npm/test/tap/outdated-git.js3
-rw-r--r--deps/npm/test/tap/outdated-git/package.json3
-rw-r--r--deps/npm/test/tap/outdated.js24
-rw-r--r--deps/npm/test/tap/prune.js107
-rw-r--r--deps/npm/test/tap/prune/package.json13
-rw-r--r--deps/npm/test/tap/repo.js52
-rw-r--r--deps/npm/test/tap/shrinkwrap-dev-dependency.js66
-rw-r--r--deps/npm/test/tap/shrinkwrap-dev-dependency/desired-shrinkwrap-results.json12
-rw-r--r--deps/npm/test/tap/shrinkwrap-dev-dependency/package.json12
-rw-r--r--deps/npm/test/tap/shrinkwrap-shared-dev-dependency.js58
-rw-r--r--deps/npm/test/tap/shrinkwrap-shared-dev-dependency/desired-shrinkwrap-results.json12
-rw-r--r--deps/npm/test/tap/shrinkwrap-shared-dev-dependency/package.json11
19 files changed, 554 insertions, 5 deletions
diff --git a/deps/npm/test/tap/dedupe.js b/deps/npm/test/tap/dedupe.js
index 3f57bf02b..9a8b31a79 100644
--- a/deps/npm/test/tap/dedupe.js
+++ b/deps/npm/test/tap/dedupe.js
@@ -6,7 +6,7 @@ var test = require("tap").test
, rimraf = require("rimraf")
test("dedupe finds the common module and moves it up one level", function (t) {
- t.plan(1)
+ t.plan(2)
setup(function () {
npm.install(".", function (err) {
@@ -14,6 +14,7 @@ test("dedupe finds the common module and moves it up one level", function (t) {
npm.dedupe(function(err) {
if (err) return t.fail(err)
t.ok(existsSync(path.join(__dirname, "dedupe", "node_modules", "minimist")))
+ t.ok(!existsSync(path.join(__dirname, "dedupe", "node_modules", "prime")))
})
})
})
diff --git a/deps/npm/test/tap/dedupe/package.json b/deps/npm/test/tap/dedupe/package.json
index 842d4b2b2..d0f79ff20 100644
--- a/deps/npm/test/tap/dedupe/package.json
+++ b/deps/npm/test/tap/dedupe/package.json
@@ -4,6 +4,8 @@
"version": "0.0.0",
"dependencies": {
"optimist": "0.6.0",
- "clean": "2.1.6"
+ "clean": "2.1.6",
+ "informal": "0.0.1",
+ "pathogen": "0.1.5"
}
}
diff --git a/deps/npm/test/tap/git-cache-locking.js b/deps/npm/test/tap/git-cache-locking.js
new file mode 100644
index 000000000..cfea78da4
--- /dev/null
+++ b/deps/npm/test/tap/git-cache-locking.js
@@ -0,0 +1,43 @@
+var test = require("tap").test
+ , path = require("path")
+ , rimraf = require("rimraf")
+ , mkdirp = require("mkdirp")
+ , spawn = require("child_process").spawn
+ , npm = require.resolve("../../bin/npm-cli.js")
+ , node = process.execPath
+ , pkg = path.resolve(__dirname, "git-cache-locking")
+ , tmp = path.join(pkg, "tmp")
+ , cache = path.join(pkg, "cache")
+
+test("git-cache-locking: install a git dependency", function (t) {
+ t.plan(1)
+
+ cleanup()
+ mkdirp.sync(cache)
+ mkdirp.sync(tmp)
+
+ // package c depends on a.git#master and b.git#master
+ // package b depends on a.git#master
+ var child = spawn(node, [npm, "install", "git://github.com/nigelzor/npm-4503-c.git"], {
+ cwd: pkg,
+ env: {
+ npm_config_cache: cache,
+ npm_config_tmp: tmp,
+ npm_config_prefix: pkg,
+ npm_config_global: "false",
+ HOME: process.env.HOME,
+ Path: process.env.PATH,
+ PATH: process.env.PATH
+ },
+ stdio: "inherit"
+ })
+
+ child.on("close", function (code) {
+ t.equal(0, code, "npm install should succeed")
+ cleanup()
+ })
+})
+
+function cleanup() {
+ rimraf.sync(pkg)
+}
diff --git a/deps/npm/test/tap/install-at-locally.js b/deps/npm/test/tap/install-at-locally.js
new file mode 100644
index 000000000..18ea6c3a6
--- /dev/null
+++ b/deps/npm/test/tap/install-at-locally.js
@@ -0,0 +1,43 @@
+var common = require('../common-tap.js')
+var test = require('tap').test
+var npm = require('../../')
+var osenv = require('osenv')
+var path = require('path')
+var fs = require('fs')
+var rimraf = require('rimraf')
+var mkdirp = require('mkdirp')
+var pkg = path.join(__dirname, 'install-at-locally')
+
+test("setup", function (t) {
+ mkdirp.sync(pkg)
+ mkdirp.sync(path.resolve(pkg, 'node_modules'))
+ process.chdir(pkg)
+ t.end()
+})
+
+test('"npm install ./package@1.2.3" should install local pkg', function(t) {
+ npm.load(function() {
+ npm.commands.install(['./package@1.2.3'], function(err) {
+ var p = path.resolve(pkg, 'node_modules/install-at-locally/package.json')
+ t.ok(JSON.parse(fs.readFileSync(p, 'utf8')))
+ t.end()
+ })
+ })
+})
+
+test('"npm install install/at/locally@./package@1.2.3" should install local pkg', function(t) {
+ npm.load(function() {
+ npm.commands.install(['./package@1.2.3'], function(err) {
+ var p = path.resolve(pkg, 'node_modules/install-at-locally/package.json')
+ t.ok(JSON.parse(fs.readFileSync(p, 'utf8')))
+ t.end()
+ })
+ })
+})
+
+test('cleanup', function(t) {
+ process.chdir(__dirname)
+ rimraf.sync(path.resolve(pkg, 'node_modules'))
+ t.end()
+})
+
diff --git a/deps/npm/test/tap/install-at-locally/package@1.2.3/package.json b/deps/npm/test/tap/install-at-locally/package@1.2.3/package.json
new file mode 100644
index 000000000..b11d00c65
--- /dev/null
+++ b/deps/npm/test/tap/install-at-locally/package@1.2.3/package.json
@@ -0,0 +1,5 @@
+{
+ "name": "install-at-locally",
+ "version": "0.0.0",
+ "description": "Test for 404-parent"
+}
diff --git a/deps/npm/test/tap/npm-api-not-loaded-error.js b/deps/npm/test/tap/npm-api-not-loaded-error.js
new file mode 100644
index 000000000..3fd073110
--- /dev/null
+++ b/deps/npm/test/tap/npm-api-not-loaded-error.js
@@ -0,0 +1,47 @@
+var test = require("tap").test
+var npm = require("../..")
+var path = require("path")
+var rimraf = require("rimraf")
+var npmrc = path.join(__dirname, "npmrc")
+var fs = require("fs")
+
+test("setup", function (t) {
+ fs.writeFileSync(npmrc, "foo = bar\n", "ascii")
+ t.end()
+})
+
+test("calling set/get on config pre-load should throw", function (t) {
+ var threw = true
+ try {
+ npm.config.get("foo")
+ threw = false
+ } catch (er) {
+ t.equal(er.message, "npm.load() required")
+ } finally {
+ t.ok(threw, "get before load should throw")
+ }
+
+ var threw = true
+ try {
+ npm.config.set("foo", "bar")
+ threw = false
+ } catch (er) {
+ t.equal(er.message, "npm.load() required")
+ } finally {
+ t.ok(threw, "set before load should throw")
+ }
+
+ npm.load({ userconfig: npmrc }, function (er) {
+ if (er)
+ throw er
+ t.equal(npm.config.get("foo"), "bar")
+ npm.config.set("foo", "baz")
+ t.equal(npm.config.get("foo"), "baz")
+ t.end()
+ })
+})
+
+test("cleanup", function (t) {
+ rimraf.sync(npmrc)
+ t.end()
+})
diff --git a/deps/npm/test/tap/outdated-color.js b/deps/npm/test/tap/outdated-color.js
new file mode 100644
index 000000000..e729d56a8
--- /dev/null
+++ b/deps/npm/test/tap/outdated-color.js
@@ -0,0 +1,41 @@
+var common = require("../common-tap.js")
+var test = require("tap").test
+var npm = require("../../")
+var mkdirp = require("mkdirp")
+var rimraf = require("rimraf")
+var mr = require("npm-registry-mock")
+var exec = require('child_process').exec
+
+var pkg = __dirname + '/outdated'
+var NPM_BIN = __dirname + '/../../bin/npm-cli.js'
+mkdirp.sync(pkg + "/cache")
+
+function hasControlCodes(str) {
+ return str.length !== ansiTrim(str).length
+}
+
+function ansiTrim (str) {
+ var r = new RegExp("\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|" +
+ "\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g");
+ return str.replace(r, "")
+}
+
+// note hard to automate tests for color = true
+// as npm kills the color config when it detects
+// it's not running in a tty
+test("does not use ansi styling", function (t) {
+ t.plan(3)
+ exec('node ' + NPM_BIN + ' outdated --color false', {
+ cwd: pkg
+ }, function(err, stdout) {
+ t.ifError(err)
+ t.ok(stdout, stdout.length)
+ t.ok(!hasControlCodes(stdout))
+ })
+})
+
+test("cleanup", function (t) {
+ rimraf.sync(pkg + "/cache")
+ t.end()
+})
+
diff --git a/deps/npm/test/tap/outdated-git.js b/deps/npm/test/tap/outdated-git.js
index dda2abccc..933e3b0b4 100644
--- a/deps/npm/test/tap/outdated-git.js
+++ b/deps/npm/test/tap/outdated-git.js
@@ -12,13 +12,14 @@ mkdirp.sync(pkg + "/cache")
test("dicovers new versions in outdated", function (t) {
process.chdir(pkg)
- t.plan(4)
+ t.plan(5)
npm.load({cache: pkg + "/cache", registry: common.registry}, function () {
npm.outdated(function (er, d) {
t.equal('git', d[0][3])
t.equal('git', d[0][4])
t.equal('git://github.com/robertkowalski/foo-private.git', d[0][5])
t.equal('git://user:pass@github.com/robertkowalski/foo-private.git', d[1][5])
+ t.equal('git://github.com/robertkowalski/foo', d[2][5])
})
})
})
diff --git a/deps/npm/test/tap/outdated-git/package.json b/deps/npm/test/tap/outdated-git/package.json
index e160a21cc..209936dde 100644
--- a/deps/npm/test/tap/outdated-git/package.json
+++ b/deps/npm/test/tap/outdated-git/package.json
@@ -6,6 +6,7 @@
"main": "index.js",
"dependencies": {
"foo-private": "git://github.com/robertkowalski/foo-private.git",
- "foo-private-credentials": "git://user:pass@github.com/robertkowalski/foo-private.git"
+ "foo-private-credentials": "git://user:pass@github.com/robertkowalski/foo-private.git",
+ "foo-github": "robertkowalski/foo"
}
}
diff --git a/deps/npm/test/tap/outdated.js b/deps/npm/test/tap/outdated.js
index 3a9951b3c..dddec77ea 100644
--- a/deps/npm/test/tap/outdated.js
+++ b/deps/npm/test/tap/outdated.js
@@ -8,19 +8,41 @@ var mr = require("npm-registry-mock")
// config
var pkg = __dirname + '/outdated'
+var path = require("path")
+
test("it should not throw", function (t) {
cleanup()
process.chdir(pkg)
+ var originalLog = console.log
+ var output = []
+ var expOut = [ path.resolve(__dirname, "outdated/node_modules/underscore")
+ , path.resolve(__dirname, "outdated/node_modules/underscore")
+ + ":underscore@1.3.1"
+ + ":underscore@1.3.1"
+ + ":underscore@1.5.1" ]
+ var expData = [ [ path.resolve(__dirname, "outdated")
+ , "underscore"
+ , "1.3.1"
+ , "1.3.1"
+ , "1.5.1"
+ , "1.3.1" ] ]
+
+ console.log = function () {
+ output.push.apply(output, arguments)
+ }
mr(common.port, function (s) {
npm.load({
cache: pkg + "/cache",
loglevel: 'silent',
+ parseable: true,
registry: common.registry }
, function () {
npm.install(".", function (err) {
npm.outdated(function (er, d) {
- console.log(d)
+ console.log = originalLog
+ t.same(output, expOut)
+ t.same(d, expData)
s.close()
t.end()
})
diff --git a/deps/npm/test/tap/prune.js b/deps/npm/test/tap/prune.js
new file mode 100644
index 000000000..acfdc42e3
--- /dev/null
+++ b/deps/npm/test/tap/prune.js
@@ -0,0 +1,107 @@
+var test = require("tap").test
+var fs = require("fs")
+var node = process.execPath
+var npm = require.resolve("../../bin/npm-cli.js")
+var rimraf = require("rimraf")
+var mr = require("npm-registry-mock")
+var common = require("../common-tap.js")
+var spawn = require("child_process").spawn
+
+var pkg = __dirname + "/prune"
+
+var server
+
+test("reg mock", function (t) {
+ mr(common.port, function (s) {
+ server = s
+ t.pass("registry mock started")
+ t.end()
+ })
+})
+
+test("npm install", function (t) {
+ var c = spawn(node, [
+ npm, "install",
+ "--registry=" + common.registry,
+ "--loglevel=silent",
+ "--production=false"
+ ], { cwd: pkg })
+ c.stderr.on("data", function(d) {
+ t.fail("Should not get data on stderr: " + d)
+ })
+ c.on("close", function(code) {
+ t.notOk(code, "exit ok")
+ t.end()
+ })
+})
+
+test("npm install test-package", function (t) {
+ var c = spawn(node, [
+ npm, "install", "test-package",
+ "--registry=" + common.registry,
+ "--loglevel=silent",
+ "--production=false"
+ ], { cwd: pkg })
+ c.stderr.on("data", function(d) {
+ t.fail("Should not get data on stderr: " + d)
+ })
+ c.on("close", function(code) {
+ t.notOk(code, "exit ok")
+ t.end()
+ })
+})
+
+test("verify installs", function (t) {
+ var dirs = fs.readdirSync(pkg + "/node_modules").sort()
+ t.same(dirs, [ "test-package", "mkdirp", "underscore" ].sort())
+ t.end()
+})
+
+test("npm prune", function (t) {
+ var c = spawn(node, [
+ npm, "prune",
+ "--loglevel=silent",
+ "--production=false"
+ ], { cwd: pkg })
+ c.stderr.on("data", function(d) {
+ t.fail("Should not get data on stderr: " + d)
+ })
+ c.on("close", function(code) {
+ t.notOk(code, "exit ok")
+ t.end()
+ })
+})
+
+test("verify installs", function (t) {
+ var dirs = fs.readdirSync(pkg + "/node_modules").sort()
+ t.same(dirs, [ "mkdirp", "underscore" ])
+ t.end()
+})
+
+test("npm prune", function (t) {
+ var c = spawn(node, [
+ npm, "prune",
+ "--loglevel=silent",
+ "--production"
+ ], { cwd: pkg })
+ c.stderr.on("data", function(d) {
+ t.fail("Should not get data on stderr: " + d)
+ })
+ c.on("close", function(code) {
+ t.notOk(code, "exit ok")
+ t.end()
+ })
+})
+
+test("verify installs", function (t) {
+ var dirs = fs.readdirSync(pkg + "/node_modules").sort()
+ t.same(dirs, [ "underscore" ])
+ t.end()
+})
+
+test("cleanup", function (t) {
+ server.close()
+ rimraf.sync(pkg + "/node_modules")
+ t.pass("cleaned up")
+ t.end()
+})
diff --git a/deps/npm/test/tap/prune/package.json b/deps/npm/test/tap/prune/package.json
new file mode 100644
index 000000000..641ab6580
--- /dev/null
+++ b/deps/npm/test/tap/prune/package.json
@@ -0,0 +1,13 @@
+{
+ "name": "bla",
+ "description": "fixture",
+ "version": "0.0.1",
+ "main": "index.js",
+ "dependencies": {
+ "underscore": "1.3.1"
+ },
+ "devDependencies": {
+ "mkdirp": "*"
+ },
+ "repository": "git://github.com/robertkowalski/bogusfixture"
+}
diff --git a/deps/npm/test/tap/repo.js b/deps/npm/test/tap/repo.js
new file mode 100644
index 000000000..44671e7d5
--- /dev/null
+++ b/deps/npm/test/tap/repo.js
@@ -0,0 +1,52 @@
+if (process.platform === "win32") {
+ console.error("skipping test, because windows and shebangs")
+ return
+}
+
+var common = require("../common-tap.js")
+var mr = require("npm-registry-mock")
+
+var test = require("tap").test
+var npm = require.resolve("../../bin/npm-cli.js")
+var node = process.execPath
+var rimraf = require("rimraf")
+var spawn = require("child_process").spawn
+var fs = require("fs")
+
+test("setup", function (t) {
+ var s = "#!/usr/bin/env bash\n" +
+ "echo \"$@\" > " + JSON.stringify(__dirname) + "/_output\n"
+ fs.writeFileSync(__dirname + "/_script.sh", s, "ascii")
+ fs.chmodSync(__dirname + "/_script.sh", "0755")
+ t.pass("made script")
+ t.end()
+})
+
+test("npm repo underscore", function (t) {
+ mr(common.port, function (s) {
+ var c = spawn(node, [
+ npm, "repo", "underscore",
+ "--registry=" + common.registry,
+ "--loglevel=silent",
+ "--browser=" + __dirname + "/_script.sh",
+ ])
+ c.stdout.on("data", function(d) {
+ t.fail("Should not get data on stdout: " + d)
+ })
+ c.stderr.pipe(process.stderr)
+ c.on("close", function(code) {
+ t.equal(code, 0, "exit ok")
+ var res = fs.readFileSync(__dirname + "/_output", "ascii")
+ s.close()
+ t.equal(res, "https://github.com/jashkenas/underscore\n")
+ t.end()
+ })
+ })
+})
+
+test("cleanup", function (t) {
+ fs.unlinkSync(__dirname + "/_script.sh")
+ fs.unlinkSync(__dirname + "/_output")
+ t.pass("cleaned up")
+ t.end()
+})
diff --git a/deps/npm/test/tap/shrinkwrap-dev-dependency.js b/deps/npm/test/tap/shrinkwrap-dev-dependency.js
new file mode 100644
index 000000000..fc606cf40
--- /dev/null
+++ b/deps/npm/test/tap/shrinkwrap-dev-dependency.js
@@ -0,0 +1,66 @@
+var npm = npm = require("../../")
+var test = require("tap").test
+var path = require("path")
+var fs = require("fs")
+var osenv = require("osenv")
+var rimraf = require("rimraf")
+var mr = require("npm-registry-mock")
+var common = require("../common-tap.js")
+
+var pkg = path.resolve(__dirname, "shrinkwrap-dev-dependency")
+var desiredResultsPath = path.resolve(pkg, "desired-shrinkwrap-results.json")
+
+test("shrinkwrap doesn't strip out the dependency", function (t) {
+ t.plan(1)
+
+ mr(common.port, function (s) {
+ setup({ production: true }, function (err) {
+ if (err) return t.fail(err)
+
+ npm.install(".", function (err) {
+ if (err) return t.fail(err)
+
+ npm.commands.shrinkwrap([], true, function (err, results) {
+ if (err) return t.fail(err)
+
+ fs.readFile(desiredResultsPath, function (err, desired) {
+ if (err) return t.fail(err)
+
+ t.deepEqual(results, JSON.parse(desired))
+ s.close()
+ t.end()
+ })
+ })
+ })
+ })
+ })
+})
+
+test("cleanup", function (t) {
+ cleanup()
+ t.end()
+})
+
+
+function setup (opts, cb) {
+ cleanup()
+ process.chdir(pkg)
+
+ var allOpts = {
+ cache: path.resolve(pkg, "cache"),
+ registry: common.registry
+ }
+
+ for (var key in opts) {
+ allOpts[key] = opts[key]
+ }
+
+ npm.load(allOpts, cb)
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(path.resolve(pkg, "node_modules"))
+ rimraf.sync(path.resolve(pkg, "cache"))
+ rimraf.sync(path.resolve(pkg, "npm-shrinkwrap.json"))
+}
diff --git a/deps/npm/test/tap/shrinkwrap-dev-dependency/desired-shrinkwrap-results.json b/deps/npm/test/tap/shrinkwrap-dev-dependency/desired-shrinkwrap-results.json
new file mode 100644
index 000000000..7f87e833e
--- /dev/null
+++ b/deps/npm/test/tap/shrinkwrap-dev-dependency/desired-shrinkwrap-results.json
@@ -0,0 +1,12 @@
+{
+ "name": "npm-test-shrinkwrap-dev-dependency",
+ "version": "0.0.0",
+ "dependencies": {
+ "request": {
+ "version": "0.9.0"
+ },
+ "underscore": {
+ "version": "1.3.1"
+ }
+ }
+}
diff --git a/deps/npm/test/tap/shrinkwrap-dev-dependency/package.json b/deps/npm/test/tap/shrinkwrap-dev-dependency/package.json
new file mode 100644
index 000000000..e325a4731
--- /dev/null
+++ b/deps/npm/test/tap/shrinkwrap-dev-dependency/package.json
@@ -0,0 +1,12 @@
+{
+ "author": "Domenic Denicola",
+ "name": "npm-test-shrinkwrap-dev-dependency",
+ "version": "0.0.0",
+ "dependencies": {
+ "request": "0.9.0",
+ "underscore": "1.3.1"
+ },
+ "devDependencies": {
+ "underscore": "1.5.1"
+ }
+}
diff --git a/deps/npm/test/tap/shrinkwrap-shared-dev-dependency.js b/deps/npm/test/tap/shrinkwrap-shared-dev-dependency.js
new file mode 100644
index 000000000..75f1765fc
--- /dev/null
+++ b/deps/npm/test/tap/shrinkwrap-shared-dev-dependency.js
@@ -0,0 +1,58 @@
+var npm = npm = require("../../")
+var test = require("tap").test
+var path = require("path")
+var fs = require("fs")
+var osenv = require("osenv")
+var rimraf = require("rimraf")
+var mr = require("npm-registry-mock")
+var common = require("../common-tap.js")
+
+var pkg = path.resolve(__dirname, "shrinkwrap-shared-dev-dependency")
+var desiredResultsPath = path.resolve(pkg, "desired-shrinkwrap-results.json")
+
+test("shrinkwrap doesn't strip out the shared dependency", function (t) {
+ t.plan(1)
+
+ mr(common.port, function (s) {
+ setup(function (err) {
+ if (err) return t.fail(err)
+
+ npm.install(".", function (err) {
+ if (err) return t.fail(err)
+
+ npm.commands.shrinkwrap([], true, function (err, results) {
+ if (err) return t.fail(err)
+
+ fs.readFile(desiredResultsPath, function (err, desired) {
+ if (err) return t.fail(err)
+
+ t.deepEqual(results, JSON.parse(desired))
+ s.close()
+ t.end()
+ })
+ })
+ })
+ })
+ })
+})
+
+test("cleanup", function (t) {
+ cleanup()
+ t.end()
+})
+
+
+function setup (cb) {
+ cleanup()
+ process.chdir(pkg)
+
+ var opts = { cache: path.resolve(pkg, "cache"), registry: common.registry }
+ npm.load(opts, cb)
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(path.resolve(pkg, "node_modules"))
+ rimraf.sync(path.resolve(pkg, "cache"))
+ rimraf.sync(path.resolve(pkg, "npm-shrinkwrap.json"))
+}
diff --git a/deps/npm/test/tap/shrinkwrap-shared-dev-dependency/desired-shrinkwrap-results.json b/deps/npm/test/tap/shrinkwrap-shared-dev-dependency/desired-shrinkwrap-results.json
new file mode 100644
index 000000000..230b68761
--- /dev/null
+++ b/deps/npm/test/tap/shrinkwrap-shared-dev-dependency/desired-shrinkwrap-results.json
@@ -0,0 +1,12 @@
+{
+ "name": "npm-test-shrinkwrap-shared-dev-dependency",
+ "version": "0.0.0",
+ "dependencies": {
+ "test-package-with-one-dep": {
+ "version": "0.0.0"
+ },
+ "test-package": {
+ "version": "0.0.0"
+ }
+ }
+}
diff --git a/deps/npm/test/tap/shrinkwrap-shared-dev-dependency/package.json b/deps/npm/test/tap/shrinkwrap-shared-dev-dependency/package.json
new file mode 100644
index 000000000..41260accf
--- /dev/null
+++ b/deps/npm/test/tap/shrinkwrap-shared-dev-dependency/package.json
@@ -0,0 +1,11 @@
+{
+ "author": "Domenic Denicola",
+ "name": "npm-test-shrinkwrap-shared-dev-dependency",
+ "version": "0.0.0",
+ "dependencies": {
+ "test-package-with-one-dep": "0.0.0"
+ },
+ "devDependencies": {
+ "test-package": "0.0.0"
+ }
+}