diff options
Diffstat (limited to 'deps/npm/test/tap/outdated-json.js')
-rw-r--r-- | deps/npm/test/tap/outdated-json.js | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/deps/npm/test/tap/outdated-json.js b/deps/npm/test/tap/outdated-json.js index 7c19561ee3..b874f28e69 100644 --- a/deps/npm/test/tap/outdated-json.js +++ b/deps/npm/test/tap/outdated-json.js @@ -5,29 +5,29 @@ var common = require("../common-tap.js") , mr = require("npm-registry-mock") , path = require("path") , osenv = require("osenv") - , spawn = require('child_process').spawn + , spawn = require("child_process").spawn , node = process.execPath - , npmc = require.resolve('../../') - , pkg = path.resolve(__dirname, 'outdated-new-versions') + , npmc = require.resolve("../../") + , pkg = path.resolve(__dirname, "outdated-new-versions") , args = [ npmc - , 'outdated' - , '--json' - , '--silent' - , '--registry=' + common.registry - , '--cache=' + pkg + '/cache' + , "outdated" + , "--json" + , "--silent" + , "--registry=" + common.registry + , "--cache=" + pkg + "/cache" ] var expected = { underscore: - { current: '1.3.3' - , wanted: '1.3.3' - , latest: '1.5.1' - , location: 'node_modules' + path.sep + 'underscore' + { current: "1.3.3" + , wanted: "1.3.3" + , latest: "1.5.1" + , location: "node_modules" + path.sep + "underscore" } , request: - { current: '0.9.5' - , wanted: '0.9.5' - , latest: '2.27.0' - , location: 'node_modules' + path.sep + 'request' + { current: "0.9.5" + , wanted: "0.9.5" + , latest: "2.27.0" + , location: "node_modules" + path.sep + "request" } } @@ -38,18 +38,19 @@ test("it should log json data", function (t) { mr(common.port, function (s) { npm.load({ cache: pkg + "/cache", - loglevel: 'silent', + loglevel: "silent", registry: common.registry } , function () { npm.install(".", function (err) { + t.ifError(err, "error should not exist") var child = spawn(node, args) - , out = '' + , out = "" child.stdout - .on('data', function (buf) { + .on("data", function (buf) { out += buf.toString() }) .pipe(process.stdout) - child.on('exit', function () { + child.on("exit", function () { out = JSON.parse(out) t.deepEqual(out, expected) s.close() |