diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2015-02-27 05:39:59 -0800 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2015-02-27 13:39:37 -0500 |
commit | 2a2fe5c4f21149ae4de66e373e1a09d94b3b6bdc (patch) | |
tree | db3251b147618da9a5f3629afabccc8c4d9b0d58 /deps/npm/test/tap/outdated-depth-deep.js | |
parent | f83d380647bd95fffd4944d371366e5b6b24d97c (diff) | |
download | node-new-2a2fe5c4f21149ae4de66e373e1a09d94b3b6bdc.tar.gz |
deps: upgrade npm to 2.6.1
PR-URL: https://github.com/iojs/io.js/pull/990
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/npm/test/tap/outdated-depth-deep.js')
-rw-r--r-- | deps/npm/test/tap/outdated-depth-deep.js | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/deps/npm/test/tap/outdated-depth-deep.js b/deps/npm/test/tap/outdated-depth-deep.js new file mode 100644 index 0000000000..c208669b37 --- /dev/null +++ b/deps/npm/test/tap/outdated-depth-deep.js @@ -0,0 +1,78 @@ +var common = require("../common-tap") + , path = require("path") + , test = require("tap").test + , rimraf = require("rimraf") + , npm = require("../../") + , mr = require("npm-registry-mock") + , pkg = path.resolve(__dirname, "outdated-depth-deep") + , cache = path.resolve(pkg, "cache") + +var osenv = require("osenv") +var mkdirp = require("mkdirp") +var fs = require("fs") + +var pj = JSON.stringify({ + "name": "whatever", + "description": "yeah idk", + "version": "1.2.3", + "main": "index.js", + "dependencies": { + "underscore": "1.3.1", + "npm-test-peer-deps": "0.0.0" + }, + "repository": "git://github.com/luk-/whatever" +}, null, 2) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + +function setup () { + mkdirp.sync(pkg) + process.chdir(pkg) + fs.writeFileSync(path.resolve(pkg, "package.json"), pj) +} + +test("setup", function (t) { + cleanup() + setup() + t.end() +}) + +test("outdated depth deep (9999)", function (t) { + var underscoreOutdated = ["underscore", "1.3.1", "1.3.1", "1.5.1", "1.3.1"] + var childPkg = path.resolve(pkg, "node_modules", "npm-test-peer-deps") + + var expected = [ [pkg].concat(underscoreOutdated), + [childPkg].concat(underscoreOutdated) ] + + process.chdir(pkg) + + mr({port : common.port}, function (er, s) { + npm.load({ + cache: cache + , loglevel: "silent" + , registry: common.registry + , depth: 9999 + } + , function () { + npm.install(".", function (er) { + if (er) throw new Error(er) + npm.outdated(function (err, d) { + if (err) throw new Error(err) + t.deepEqual(d, expected) + s.close() + t.end() + }) + }) + } + ) + }) +}) + + +test("cleanup", function (t) { + cleanup() + t.end() +}) |