diff options
Diffstat (limited to 'test/packages/npm-test-shrinkwrap')
-rw-r--r-- | test/packages/npm-test-shrinkwrap/test.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/test/packages/npm-test-shrinkwrap/test.js b/test/packages/npm-test-shrinkwrap/test.js index fba90ec65..34638c2ce 100644 --- a/test/packages/npm-test-shrinkwrap/test.js +++ b/test/packages/npm-test-shrinkwrap/test.js @@ -1,5 +1,4 @@ -var path = require("path") -var assert = require("assert") +var assert = require('assert') process.env.npm_config_prefix = process.cwd() delete process.env.npm_config_global @@ -7,13 +6,13 @@ delete process.env.npm_config_depth var npm = process.env.npm_execpath -require("child_process").execFile(process.execPath, [npm, "ls", "--json"], { - stdio: "pipe", env: process.env, cwd: process.cwd() }, +require('child_process').execFile(process.execPath, [npm, 'ls', '--json'], { + stdio: 'pipe', env: process.env, cwd: process.cwd() }, function (err, stdout, stderr) { if (err) throw err var actual = JSON.parse(stdout) - var expected = require("./npm-shrinkwrap.json") + var expected = require('./npm-shrinkwrap.json') rmFrom(actual) actual = actual.dependencies rmFrom(expected) @@ -26,10 +25,12 @@ require("child_process").execFile(process.execPath, [npm, "ls", "--json"], { function rmFrom (obj) { for (var i in obj) { - if (i === "from") + if (i === 'from') { delete obj[i] - else if (i === "dependencies") - for (var j in obj[i]) + } else if (i === 'dependencies') { + for (var j in obj[i]) { rmFrom(obj[i][j]) + } + } } } |