X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.maps.server%2Fnode%2Fnode-v4.8.0-win-x64%2Fnode_modules%2Fnpm%2Ftest%2Ftap%2Foutdated-depth-deep.js;fp=org.simantics.maps.server%2Fnode%2Fnode-v4.8.0-win-x64%2Fnode_modules%2Fnpm%2Ftest%2Ftap%2Foutdated-depth-deep.js;h=c208669b377877b6d73a178289d8147dee7803ca;hb=2529be6d456deeb07c128603ce4971f1dc29b695;hp=0000000000000000000000000000000000000000;hpb=2636fc31c16c23711cf2b06a4ae8537bba9c1d35;p=simantics%2Fdistrict.git diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-depth-deep.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-depth-deep.js new file mode 100644 index 00000000..c208669b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/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() +})