1 var common = require("../common-tap.js")
2 , test = require("tap").test
3 , rimraf = require("rimraf")
4 , npm = require("../../")
5 , mr = require("npm-registry-mock")
6 , path = require("path")
7 , spawn = require('child_process').spawn
8 , node = process.execPath
9 , npmc = require.resolve('../../')
10 , pkg = __dirname + '/outdated-new-versions'
15 , '--registry=' + common.registry
16 , '--cache=' + pkg + '/cache'
19 var expected = { underscore:
23 , location: 'node_modules' + path.sep + 'underscore'
29 , location: 'node_modules' + path.sep + 'request'
33 test("it should log json data", function (t) {
37 mr(common.port, function (s) {
39 cache: pkg + "/cache",
41 registry: common.registry }
43 npm.install(".", function (err) {
44 var child = spawn(node, args)
47 .on('data', function (buf) {
51 child.on('exit', function () {
53 t.deepEqual(out, expected)
62 test("cleanup", function (t) {
68 rimraf.sync(pkg + "/node_modules")
69 rimraf.sync(pkg + "/cache")