diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2014-05-23 21:09:37 +0400 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2014-05-23 22:03:30 +0400 |
commit | 557e80d29fdd242b4d3bfec792e3f96685e18e39 (patch) | |
tree | 8a654a89398943b63491f88602d3ff878f794247 /test | |
parent | 7b1ed497d560099c6ef90640578cb74da9249d29 (diff) |
test to ensure deps and bundleDeps match
Diffstat (limited to 'test')
-rw-r--r-- | test/tap/00-verify-bundle-deps.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/tap/00-verify-bundle-deps.js b/test/tap/00-verify-bundle-deps.js new file mode 100644 index 000000000..00291a6c4 --- /dev/null +++ b/test/tap/00-verify-bundle-deps.js @@ -0,0 +1,27 @@ +var fs = require("fs") +var path = require("path") +var test = require("tap").test + +var manifest = require("../../package.json") +var deps = Object.keys(manifest.dependencies) +var dev = Object.keys(manifest.devDependencies) +var bundled = manifest.bundleDependencies + +test("all deps are bundled deps or dev deps", function (t) { + deps.forEach(function (name) { + t.assert( + bundled.indexOf(name) !== -1, + name + " is in bundledDependencies" + ) + }) + + t.same( + fs.readdirSync(path.resolve(__dirname, '../../node_modules')).filter(function (name) { + return (dev.indexOf(name) === -1) && (name !== ".bin") + }).sort(), + bundled.sort(), + "bundleDependencies matches what's in node_modules" + ) + + t.end() +}) |