diff options
author | isaacs <i@izs.me> | 2014-08-30 02:06:19 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2014-08-30 02:43:30 +0400 |
commit | 0602f708f070d524ad41573afd4c57171cab21ad (patch) | |
tree | 23e433a5435c37202971c7984dcc91a7c4914846 /test | |
parent | 6b201dc4a170e442b38503a8df1968788a82e839 (diff) |
ls: Do not show deps of extraneous deps
Fix #6064
Diffstat (limited to 'test')
-rw-r--r-- | test/tap/nested-extraneous.js | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/test/tap/nested-extraneous.js b/test/tap/nested-extraneous.js new file mode 100644 index 000000000..fcba0418e --- /dev/null +++ b/test/tap/nested-extraneous.js @@ -0,0 +1,53 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var mkdirp = require("mkdirp") +var fs = require("fs") +var rimraf = require("rimraf") +var path = require("path") + +var pkg = path.resolve(__dirname, "nested-extraneous") +var pj = { + name: "nested-extraneous", + version: "1.2.3" +} + +var dep = path.resolve(pkg, "node_modules", "dep") +var deppj = { + name: "nested-extraneous-dep", + version: "1.2.3", + dependencies: { + "nested-extra-depdep": "*" + } +} + +var depdep = path.resolve(dep, "node_modules", "depdep") +var depdeppj = { + name: "nested-extra-depdep", + version: "1.2.3" +} + +test("setup", function (t) { + rimraf.sync(pkg) + mkdirp.sync(depdep) + fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify(pj)) + fs.writeFileSync(path.resolve(dep, "package.json"), JSON.stringify(deppj)) + fs.writeFileSync(path.resolve(depdep, "package.json"), JSON.stringify(depdeppj)) + t.end() +}) + +test("test", function (t) { + common.npm(["ls"], { + cwd: pkg + }, function (er, code, sto, ste) { + if (er) throw er + t.notEqual(code, 0) + t.notSimilar(ste, /depdep/) + t.notSimilar(sto, /depdep/) + t.end() + }) +}) + +test("clean", function (t) { + rimraf.sync(pkg) + t.end() +}) |