summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/read-installed/test/depth-1.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/read-installed/test/depth-1.js')
-rw-r--r--deps/npm/node_modules/read-installed/test/depth-1.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/deps/npm/node_modules/read-installed/test/depth-1.js b/deps/npm/node_modules/read-installed/test/depth-1.js
new file mode 100644
index 000000000..977c9276f
--- /dev/null
+++ b/deps/npm/node_modules/read-installed/test/depth-1.js
@@ -0,0 +1,23 @@
+var readInstalled = require("../read-installed.js")
+var test = require("tap").test
+var json = require("../package.json")
+var path = require("path")
+var known = [].concat(Object.keys(json.dependencies)
+ , Object.keys(json.optionalDependencies)
+ , Object.keys(json.devDependencies)).sort()
+
+test("make sure that it works with depth=1", function (t) {
+ readInstalled(path.join(__dirname, "../"), {
+ depth: 1
+ }, function (er, map) {
+ t.notOk(er, "er should be bull")
+ t.ok(map, "map should be data")
+ if (er) return console.error(er.stack || er.message)
+ var subdeps = Object.keys(map.dependencies).reduce(function(acc, dep) {
+ acc += Object.keys(map.dependencies[dep].dependencies).length;
+ return acc;
+ }, 0);
+ t.notEqual(subdeps, 0, "there should some sub dependencies")
+ t.end()
+ })
+})